Skip to content

Commit

Permalink
test: add manifest smoke test for ISO
Browse files Browse the repository at this point in the history
The existing manifest smoke test only generates the disk image manifest.
Adding a separate manifest smoke test for ISOs.  We use a separate test
that doesn't check for disk size but instead verifies the expected
pipeline names.
  • Loading branch information
achilleas-k committed Jul 3, 2024
1 parent d602369 commit 9e731b5
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions test/test_manifest.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import json
import platform
import pathlib
import platform
import subprocess
import textwrap

Expand All @@ -13,7 +13,8 @@
if not testutil.can_start_rootful_containers():
pytest.skip("tests require to be able to run rootful containers (try: sudo)", allow_module_level=True)

from containerbuild import build_container_fixture, make_container # noqa: F401
from containerbuild import build_container_fixture # noqa: F401
from containerbuild import make_container
from testcases import gen_testcases


Expand Down Expand Up @@ -49,6 +50,26 @@ def test_manifest_smoke(build_container, testcase_ref):
assert int(disk_size) == 10 * 1024 * 1024 * 1024


@pytest.mark.parametrize("testcase_ref", gen_testcases("anaconda-iso"))
def test_iso_manifest_smoke(build_container, testcase_ref):
# testcases_ref has the form "container_url,img_type1+img_type2,arch"
container_ref = testcase_ref.split(",")[0]

output = subprocess.check_output([
"podman", "run", "--rm",
"--privileged",
"--security-opt", "label=type:unconfined_t",
('--entrypoint=["/usr/bin/bootc-image-builder", "manifest", "--rootfs", "ext4", '
f'"--type=anaconda-iso", "{container_ref}"]'),
build_container,
])
manifest = json.loads(output)
# just some basic validation
expected_pipeline_names = ["build", "anaconda-tree", "rootfs-image", "efiboot-tree", "bootiso-tree", "bootiso"]
assert manifest["version"] == "2"
assert [pipeline["name"] for pipeline in manifest["pipelines"]] == expected_pipeline_names


@pytest.mark.parametrize("testcase_ref", gen_testcases("manifest"))
def test_manifest_disksize(tmp_path, build_container, testcase_ref):
# create derrived container with 6G silly file to ensure that
Expand Down

0 comments on commit 9e731b5

Please sign in to comment.