Skip to content

Commit

Permalink
test: Check the qcow2 image filesystem changes
Browse files Browse the repository at this point in the history
Make sure / is larger than the default of 10GiB and make sure there is a
new /var/log mountpoint.
  • Loading branch information
bcl authored and mvo5 committed Jun 3, 2024
1 parent b6641ae commit 4232f42
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/test_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,16 @@ def build_images(shared_tmpdir, build_container, request, force_aws_upload):
"groups": ["wheel"],
},
],
"filesystem": [
{
"mountpoint": "/",
"minsize": "12GiB"
},
{
"mountpoint": "/var/log",
"minsize": "1GiB"
},
],
"kernel": {
"append": kargs,
},
Expand Down Expand Up @@ -371,6 +381,15 @@ def test_image_boots(image_type):
# XXX: read the fully yaml instead?
assert f"image: {image_type.container_ref}" 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", gen_testcases("ami-boot"), indirect=["image_type"])
def test_ami_boots_in_aws(image_type, force_aws_upload):
Expand Down

0 comments on commit 4232f42

Please sign in to comment.