diff --git a/test/test_build.py b/test/test_build.py index 02e9da0f..193f466b 100644 --- a/test/test_build.py +++ b/test/test_build.py @@ -623,11 +623,18 @@ def test_iso_installs(image_type): def osinfo_for(it: ImageBuildResult, arch: str) -> str: + base = "Media is an installer for OS" if it.container_ref.endswith("/centos-bootc/centos-bootc:stream9"): - return f"CentOS Stream 9 ({arch})" + return f"{base} 'CentOS Stream 9 ({arch})'\n" + if it.container_ref.endswith("/centos-bootc/centos-bootc:stream10"): + # XXX: uncomment once + # https://gitlab.com/libosinfo/osinfo-db/-/commit/fc811ba5a792967e22a0108de5a245b23da3cc66 + # gets released + # return f"CentOS Stream 10 ({arch})" + return "" if "/fedora/fedora-bootc:" in it.container_ref: ver = it.container_ref.rsplit(":", maxsplit=1)[1] - return f"Fedora Server {ver} ({arch})" + return f"{base} 'Fedora Server {ver} ({arch})'\n" raise ValueError(f"unknown osinfo string for '{it.container_ref}'") @@ -643,7 +650,7 @@ def test_iso_os_detection(image_type): installer_iso_path, ], capture_output=True, text=True, check=True) osinfo_output = result.stdout - expected_output = f"Media is bootable.\nMedia is an installer for OS '{osinfo_for(image_type, arch)}'\n" + expected_output = f"Media is bootable.\n{osinfo_for(image_type, arch)}" assert osinfo_output == expected_output diff --git a/test/testcases.py b/test/testcases.py index f60aa8cb..78d8e926 100644 --- a/test/testcases.py +++ b/test/testcases.py @@ -60,6 +60,13 @@ class TestCaseC9S(TestCase): "quay.io/centos-bootc/centos-bootc:stream9") +@dataclasses.dataclass +class TestCaseC10S(TestCase): + container_ref: str = os.getenv( + "BIB_TEST_BOOTC_CONTAINER_TAG", + "quay.io/centos-bootc/centos-bootc:stream10") + + def test_testcase_nameing(): """ Ensure the testcase naming does not change without us knowing as those @@ -70,14 +77,6 @@ def test_testcase_nameing(): assert f"{tc}" == expected, f"{tc} != {expected}" -@dataclasses.dataclass -class TestCaseC10S(TestCase): - container_ref: str = os.getenv( - "BIB_TEST_BOOTC_CONTAINER_TAG", - "quay.io/centos-bootc/centos-bootc:stream10") - osinfo_template: str = "CentOS Stream 10 ({arch})" - - def gen_testcases(what): # pylint: disable=too-many-return-statements if what == "manifest": return [TestCaseC9S(), TestCaseFedora(), TestCaseC10S()]