From 4222c658a718eba9fbc31ab91b59ee1f3d73b442 Mon Sep 17 00:00:00 2001 From: "Brian C. Lane" Date: Mon, 15 Jan 2024 17:51:25 -0800 Subject: [PATCH] test: Check the qcow2 image filesystem changes Make sure / is larger than the default of 10GiB and make sure there is a new /var/log mountpoint. --- test/test_smoke.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/test/test_smoke.py b/test/test_smoke.py index e6bf47c66..1546b57a0 100644 --- a/test/test_smoke.py +++ b/test/test_smoke.py @@ -102,6 +102,16 @@ def image_type_fixture(tmpdir_factory, build_container, request, force_aws_uploa "groups": ["wheel"], }, ], + "filesystem": [ + { + "mountpoint": "/", + "minsize": "12GiB" + }, + { + "mountpoint": "/var/log", + "minsize": "1GiB" + } + ] }, }, } @@ -179,6 +189,18 @@ def test_image_boots(image_type): exit_status, output = test_vm.run("echo hello", user=image_type.username, password=image_type.password) assert exit_status == 0 assert "hello" in output + exit_status, output = test_vm.run("df --output=target,size", user=image_type.username, password=image_type.password) + assert exit_status == 0 + assert "/var/log" in output + + # Figure out how big / is and make sure it is > 10GiB + # Note that df output is in 1k blocks, not bytes + for line in output.splitlines(): + fields = line.split() + if fields[0] == "/sysroot": + size = int(fields[1]) + assert size > 10 * 1024 * 1024 + break @pytest.mark.parametrize("image_type", ["ami"], indirect=["image_type"])