Skip to content

Commit e849640

Browse files
mvo5achilleas-k
authored andcommitted
test: convert test_manifest_disk_customization_lvm to TOML
By moving the LVM disk customization test to TOML we will catch issues with our TOML parsing early, i.e. we can catch the regression we encountered when applying strict TOML parsing. This is also tested in osbuild/blueprint#12 but having it here again for good measure is a good idea.
1 parent 462c545 commit e849640

File tree

1 file changed

+13
-23
lines changed

1 file changed

+13
-23
lines changed

test/test_manifest.py

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -608,33 +608,23 @@ def test_manifest_disk_customization_lvm(tmp_path, build_container):
608608
container_ref = "quay.io/centos-bootc/centos-bootc:stream9"
609609
testutil.pull_container(container_ref)
610610

611-
config = {
612-
"customizations": {
613-
"disk": {
614-
"partitions": [
615-
{
616-
"type": "lvm",
617-
"minsize": "10 GiB",
618-
"logical_volumes": [
619-
{
620-
"minsize": "10 GiB",
621-
"fs_type": "ext4",
622-
"mountpoint": "/",
623-
}
624-
]
625-
}
626-
]
627-
}
628-
}
629-
}
630-
config_path = tmp_path / "config.json"
631-
with config_path.open("w") as config_file:
632-
json.dump(config, config_file)
611+
config = textwrap.dedent("""\
612+
[[customizations.disk.partitions]]
613+
type = "lvm"
614+
minsize = "10 GiB"
615+
616+
[[customizations.disk.partitions.logical_volumes]]
617+
minsize = "10 GiB"
618+
fs_type = "ext4"
619+
mountpoint = "/"
620+
""")
621+
config_path = tmp_path / "config.toml"
622+
config_path.write_text(config)
633623

634624
testutil.pull_container(container_ref)
635625
output = subprocess.check_output([
636626
*testutil.podman_run_common,
637-
"-v", f"{config_path}:/config.json:ro",
627+
"-v", f"{config_path}:/config.toml:ro",
638628
build_container,
639629
"manifest", f"{container_ref}",
640630
])

0 commit comments

Comments
 (0)