Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add testing for libica being in FIPS 140-3 mode #612

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 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,23 @@ 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"
)
)
Loading