From a920978032e549cea063fbe98798042adab7c994 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dirk=20M=C3=BCller?= Date: Fri, 2 Aug 2024 18:18:13 +0200 Subject: [PATCH] Fix handling of the ironbank base container The ironbank base container is a fips container but actually called bci-base. --- bci_tester/data.py | 19 ++++++++++--------- tests/test_base.py | 8 +++++++- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/bci_tester/data.py b/bci_tester/data.py index 42382fe4..434b889b 100755 --- a/bci_tester/data.py +++ b/bci_tester/data.py @@ -379,15 +379,16 @@ def create_BCI( image_type="kiwi", bci_type=ImageType.OS, ) - BASE_FIPS_CONTAINERS = [ - create_BCI( - build_tag=f"{BCI_CONTAINER_PREFIX}/bci-base-fips:{OS_CONTAINER_TAG}", - bci_type=ImageType.OS, - # TODO set to _DEFAULT_BASE_OS_VERSIONS once the fips containers are available - # everywhere - available_versions=("15.6",), - ) - ] + if TARGET not in ("dso",): + BASE_FIPS_CONTAINERS = [ + create_BCI( + build_tag=f"{BCI_CONTAINER_PREFIX}/bci-base-fips:{OS_CONTAINER_TAG}", + bci_type=ImageType.OS, + # TODO set to _DEFAULT_BASE_OS_VERSIONS once the fips containers are available + # everywhere + available_versions=("15.6",), + ) + ] if TARGET in ("ibs", "ibs-cr", "ibs-released"): LTSS_BASE_CONTAINERS.extend( create_BCI( diff --git a/tests/test_base.py b/tests/test_base.py index fdfdcccd..d2b7399f 100644 --- a/tests/test_base.py +++ b/tests/test_base.py @@ -16,6 +16,7 @@ from bci_tester.data import LTSS_BASE_CONTAINERS from bci_tester.data import LTSS_BASE_FIPS_CONTAINERS from bci_tester.data import OS_VERSION +from bci_tester.data import TARGET from bci_tester.fips import ALL_DIGESTS from bci_tester.fips import FIPS_DIGESTS from bci_tester.fips import host_fips_enabled @@ -72,6 +73,7 @@ def test_base_size(container: ContainerData, container_runtime): and container.container.baseurl.rpartition("/")[2].startswith( "bci-base-fips" ) + or TARGET in ("dso",) ) #: size limits of the base container per arch in MiB @@ -81,6 +83,9 @@ def test_base_size(container: ContainerData, container_runtime): base_container_max_size: Dict[str, int] = { "x86_64": 130 if OS_VERSION in ("15.3",) else 169, } + if TARGET in ("dso",): + # the dso container is larger than the bci-base-fips container + base_container_max_size["x86_64"] += 10 elif OS_VERSION in ("tumbleweed",): base_container_max_size: Dict[str, int] = { "x86_64": 100, @@ -183,7 +188,8 @@ def test_openssl_hashes(container): @pytest.mark.parametrize( "container_per_test", - [*LTSS_BASE_FIPS_CONTAINERS, *BASE_FIPS_CONTAINERS], + [*LTSS_BASE_FIPS_CONTAINERS, *BASE_FIPS_CONTAINERS] + + ([BASE_CONTAINER] if TARGET in ("dso",) else []), indirect=True, ) def test_openssl_fips_hashes(container_per_test):