Skip to content

Commit

Permalink
Add testing for libica being in FIPS 140-3 mode
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkmueller committed Oct 8, 2024
1 parent 35aefbb commit 548c728
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/test_fips.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from pytest_container.container import BindMount
from pytest_container.container import ContainerData
from pytest_container.container import container_and_marks_from_pytest_param
from pytest_container.runtime import LOCALHOST

from bci_tester.data import BASE_FIPS_CONTAINERS
from bci_tester.data import CONTAINERS_WITH_ZYPPER
Expand Down Expand Up @@ -296,3 +297,22 @@ def test_gpgconf_binary(container_per_test: ContainerData) -> None:
assert container_per_test.connection.check_output(
"gpgconf --show-versions | sed -n '/fips-mode:[yn]:/p' "
).startswith("fips-mode:y:")


@pytest.mark.skipif(
LOCALHOST.system_info.arch != "s390x",
reason="libica is s390x specific"
)
@pytest.mark.skipif(
OS_VERSION in ("15.3",), reason="FIPS 140-3 not supported on 15.3"
)
@pytest.mark.parametrize(
"container_per_test", FIPS_TESTER_IMAGES, indirect=True
)
def test_icainfo_binary(container_per_test: ContainerData) -> None:
"""Check that icainfo -f returns 'FIPS 140-3 mode active'
"""

assert "FIPS 140-3 mode active" in container_per_test.connection.check_output(
"zypper -n install libica-tools && icainfo -f"
)

0 comments on commit 548c728

Please sign in to comment.