Skip to content

Commit

Permalink
test: add custom mountpoints for non-btrfs tests
Browse files Browse the repository at this point in the history
When the rootfs type supports it, add extra mountpoints to the test
build.
Btrfs subvolumes are not supported.
  • Loading branch information
achilleas-k committed Aug 9, 2024
1 parent 965a2ba commit 1d7ca7d
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 6 deletions.
7 changes: 1 addition & 6 deletions test/test_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,7 @@ def build_images(shared_tmpdir, build_container, request, force_aws_upload):
"groups": ["wheel"],
},
],
"filesystem": [
{
"mountpoint": "/",
"minsize": "12GiB"
},
],
"filesystem": testutil.create_filesystem_customizations(tc.rootfs),
"kernel": {
"append": kargs,
},
Expand Down
31 changes: 31 additions & 0 deletions test/testutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,37 @@ def deregister_ami(ami_id):
print(f"Error {err_code}: {err_msg}")


def create_filesystem_customizations(rootfs: str):
if rootfs == "btrfs":
# only minimal customizations are supported for btrfs currently
return [
{
"mountpoint": "/",
"minsize": "12 GiB"
},
]

# add some custom mountpoints
return [
{
"mountpoint": "/",
"minsize": "12 GiB"
},
{
"mountpoint": "/var/data",
"minsize": "3 GiB"
},
{
"mountpoint": "/var/data/test",
"minsize": "1 GiB"
},
{
"mountpoint": "/var/opt",
"minsize": "2 GiB"
},
]


# podman_run_common has the common prefix for the podman run invocations
podman_run_common = [
"podman", "run", "--rm",
Expand Down

0 comments on commit 1d7ca7d

Please sign in to comment.