-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: test both `quay.io/centos-bootc/{centos,fedora}-bootc:{eln,stre…
…am9}` Now that `bib` supports both fedora and centos bootc we need to start testing both as part of the integration suite.
- Loading branch information
Showing
5 changed files
with
71 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
[pytest] | ||
# do not use /tmp by default as it may be on a tempfs and our tests can | ||
# generate 10G images (that full of holes so not really 10G but still) | ||
addopts = --basetemp=/var/tmp | ||
addopts = --basetemp=/var/tmp/bib-tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import os | ||
|
||
|
||
def gen_testcases(what): | ||
# supported images that can be directly booted | ||
DIRECT_BOOT_IMAGE_TYPES = ("qcow2", "ami", "raw") | ||
# supported images that require an install | ||
INSTALLER_IMAGE_TYPES = ("iso",) | ||
|
||
# bootc containers that are tested by default | ||
CONTAINERS_TO_TEST = { | ||
"fedora": "quay.io/centos-bootc/fedora-bootc:eln", | ||
"centos": "quay.io/centos-bootc/centos-bootc:stream9", | ||
} | ||
# allow commandline override, this is used when testing | ||
# custom images | ||
if os.getenv("BIB_TEST_BOOTC_CONTAINER_TAG"): | ||
# TODO: make this more elegant | ||
CONTAINERS_TO_TEST = { | ||
"centos": os.getenv("BIB_TEST_BOOTC_CONTAINER_TAG"), | ||
"fedora": [], | ||
} | ||
|
||
if what == "manifest": | ||
return CONTAINERS_TO_TEST.values() | ||
elif what == "ami-boot": | ||
return [cnt + ",ami" for cnt in CONTAINERS_TO_TEST.values()] | ||
elif what == "iso": | ||
test_cases = [] | ||
# only fedora right now, centos iso installer is broken right now: | ||
# https://github.com/osbuild/bootc-image-builder/issues/157 | ||
cnt = CONTAINERS_TO_TEST["fedora"] | ||
for img_type in INSTALLER_IMAGE_TYPES: | ||
test_cases.append(f"{cnt},{img_type}") | ||
return test_cases | ||
elif what == "direct-boot": | ||
# skip some raw/ami tests (they are identical right now) to | ||
# avoid overlong test runs but revisit this later and maybe just | ||
# do more in parallel? | ||
test_cases = [ | ||
CONTAINERS_TO_TEST["centos"] + "," + DIRECT_BOOT_IMAGE_TYPES[0], | ||
CONTAINERS_TO_TEST["fedora"] + "," + DIRECT_BOOT_IMAGE_TYPES[1], | ||
CONTAINERS_TO_TEST["centos"] + "," + DIRECT_BOOT_IMAGE_TYPES[2], | ||
CONTAINERS_TO_TEST["fedora"] + "," + DIRECT_BOOT_IMAGE_TYPES[0], | ||
] | ||
return test_cases | ||
elif what == "all": | ||
test_cases = [] | ||
for cnt in CONTAINERS_TO_TEST.values(): | ||
for img_type in DIRECT_BOOT_IMAGE_TYPES + INSTALLER_IMAGE_TYPES: | ||
test_cases.append(f"{cnt},{img_type}") | ||
return test_cases | ||
raise ValueError(f"unknown test-case type {what}") |