stages/locale: Refactor locale stage to look like similar ones

The locale stage now cannot be used to set the keymap. Use the keymap
stage instead. Also, the stage was refactored to look like keymap and
timezone stages just to be consistent (systemd-firstboot is now used).
This commit is contained in:
Ondřej Budai 2019-09-09 10:55:58 +02:00 committed by Lars Karlitski
parent 8fa41de07c
commit 7fabcfe333
3 changed files with 60 additions and 8 deletions

View file

@ -28,6 +28,12 @@ def test_firewall(extract_dir):
assert 'port port="88" protocol="udp"' in content
def test_locale(extract_dir):
with open(f"{extract_dir}/etc/locale.conf") as f:
content = f.read()
assert 'LANG=nn_NO.utf8' in content
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Run integration tests')
parser.add_argument('--list', dest='list', action='store_true', help='list test cases')
@ -64,8 +70,16 @@ if __name__ == '__main__':
test_cases=[test_firewall],
type=IntegrationTestType.EXTRACT
)
locale = IntegrationTestCase(
name="locale",
pipeline="locale.json",
build_pipeline=args.build_pipeline,
output_image="locale.tar.xz",
test_cases=[test_locale],
type=IntegrationTestType.EXTRACT
)
cases = [f30_boot, timezone, firewall]
cases = [f30_boot, timezone, firewall, locale]
if args.list:
print("Available test cases:")

View file

@ -0,0 +1,32 @@
{
"name": "Example Image",
"stages": [
{
"name": "org.osbuild.dnf",
"options": {
"releasever": "30",
"repos": {
"fedora": {
"name": "Fedora",
"metalink": "https://mirrors.fedoraproject.org/metalink?repo=fedora-$releasever&arch=$basearch",
"gpgkey": "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch"
}
},
"packages": ["@Core"]
}
},
{
"name": "org.osbuild.locale",
"options": {
"language": "nn_NO.utf8"
}
}
],
"assembler": {
"name": "org.osbuild.tar",
"options": {
"filename": "locale.tar.xz",
"compression": "xz"
}
}
}