-
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
61 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,43 @@ | ||
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 = ( | ||
"quay.io/centos-bootc/fedora-bootc:eln", | ||
"quay.io/centos-bootc/centos-bootc:stream9", | ||
) | ||
# allow commandline override | ||
if os.getenv("BIB_TEST_BOOTC_CONTAINER_TAG"): | ||
CONTAINERS_TO_TEST = [os.getenv("BIB_TEST_BOOTC_CONTAINER_TAG")] | ||
|
||
if what == "manifest": | ||
return CONTAINERS_TO_TEST | ||
elif what == "ami-boot": | ||
return [cnt + ",ami" for cnt in CONTAINERS_TO_TEST] | ||
elif what == "iso": | ||
test_cases = [] | ||
for cnt in CONTAINERS_TO_TEST: | ||
for img_type in INSTALLER_IMAGE_TYPES: | ||
test_cases.append(f"{cnt},{img_type}") | ||
return test_cases | ||
elif what == "direct-boot": | ||
test_cases = [] | ||
# this is (obviously) many test-cases, we could try to be smarter here | ||
# and only test subsets (e.g. fedora-bootc,qcow2 centos-bootc,raw) | ||
for cnt in CONTAINERS_TO_TEST: | ||
for img_type in DIRECT_BOOT_IMAGE_TYPES: | ||
test_cases.append(f"{cnt},{img_type}") | ||
return test_cases | ||
elif what == "all": | ||
test_cases = [] | ||
for cnt in CONTAINERS_TO_TEST: | ||
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}") |