Skip to content

Commit

Permalink
test: run tests with centos-bootc:stream10 as well
Browse files Browse the repository at this point in the history
Rename TestCaseCentos to TestCaseS9S and add a TestCaseC10S.
  • Loading branch information
achilleas-k committed Nov 28, 2024
1 parent e4f11eb commit 8bf2719
Showing 1 changed file with 20 additions and 11 deletions.
31 changes: 20 additions & 11 deletions test/testcases.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class TestCaseFedora42(TestCase):


@dataclasses.dataclass
class TestCaseCentos(TestCase):
class TestCaseC9S(TestCase):
container_ref: str = os.getenv(
"BIB_TEST_BOOTC_CONTAINER_TAG",
"quay.io/centos-bootc/centos-bootc:stream9")
Expand All @@ -70,29 +70,38 @@ 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 [TestCaseCentos(), TestCaseFedora()]
return [TestCaseC9S(), TestCaseFedora(), TestCaseC10S()]
if what == "default-rootfs":
# Fedora doesn't have a default rootfs
return [TestCaseCentos()]
return [TestCaseC9S()]
if what == "ami-boot":
return [TestCaseCentos(image="ami"), TestCaseFedora(image="ami")]
return [TestCaseC9S(image="ami"), TestCaseFedora(image="ami")]
if what == "anaconda-iso":
return [
TestCaseFedora(image="anaconda-iso", sign=True),
TestCaseCentos(image="anaconda-iso"),
TestCaseC9S(image="anaconda-iso"),
TestCaseC10S(image="anaconda-iso"),
]
if what == "qemu-boot":
# test partition defaults with qcow2
test_cases = [
klass(image="qcow2")
for klass in (TestCaseCentos, TestCaseFedora)
for klass in (TestCaseC9S, TestCaseFedora)
]
# and custom with raw (this is arbitrary, we could do it the
# other way around too
test_cases.append(
TestCaseCentos(image="raw", partition_mode="lvm"))
TestCaseC9S(image="raw", partition_mode="lvm"))
test_cases.append(
TestCaseFedora(image="raw", partition_mode="btrfs"))
# do a cross arch test too
Expand All @@ -101,7 +110,7 @@ def gen_testcases(what): # pylint: disable=too-many-return-statements
# https://github.com/osbuild/bootc-image-builder/issues/619
# is resolved
# test_cases.append(
# TestCaseCentos(image="raw", target_arch="arm64"))
# TestCaseC9S(image="raw", target_arch="arm64"))
pass
elif platform.machine() == "arm64":
# TODO: add arm64->x86_64 cross build test too
Expand All @@ -110,21 +119,21 @@ def gen_testcases(what): # pylint: disable=too-many-return-statements
if what == "all":
return [
klass(image=img)
for klass in (TestCaseCentos, TestCaseFedora)
for klass in (TestCaseC9S, TestCaseFedora)
for img in CLOUD_BOOT_IMAGE_TYPES + DISK_IMAGE_TYPES + ["anaconda-iso"]
]
if what == "multidisk":
# single test that specifies all image types
image = "+".join(DISK_IMAGE_TYPES)
return [
TestCaseCentos(image=image),
TestCaseC9S(image=image),
TestCaseFedora(image=image),
]
# Smoke test that all supported --target-arch architecture can
# create a manifest
if what == "target-arch-smoke":
return [
TestCaseCentos(target_arch="arm64"),
TestCaseC9S(target_arch="arm64"),
# TODO: merge with TestCaseFedora once the arches are build there
TestCaseFedora42(target_arch="ppc64le"),
TestCaseFedora42(target_arch="s390x"),
Expand Down

0 comments on commit 8bf2719

Please sign in to comment.