diff --git a/bci_tester/data.py b/bci_tester/data.py index 9a3dc230..7f5e9d63 100755 --- a/bci_tester/data.py +++ b/bci_tester/data.py @@ -1459,6 +1459,7 @@ def create_BCI( MICRO_FIPS_CONTAINER, MINIMAL_CONTAINER, *NGINX_CONTAINERS, + *PYTHON_MICRO_CONTAINERS, *POSTFIX_CONTAINERS, *TOMCAT_CONTAINERS, *POSTGRESQL_CONTAINERS, @@ -1535,6 +1536,7 @@ def create_BCI( + OPENJDK_DEVEL_CONTAINERS + PCP_CONTAINERS + PYTHON_CONTAINERS + + PYTHON_MICRO_CONTAINERS + RMT_CONTAINERS + RUBY_CONTAINERS + RUST_CONTAINERS diff --git a/tests/test_metadata.py b/tests/test_metadata.py index 7b899fd4..e86ca445 100644 --- a/tests/test_metadata.py +++ b/tests/test_metadata.py @@ -91,6 +91,7 @@ from bci_tester.data import POSTGRESQL_CONTAINERS from bci_tester.data import PROMETHEUS_CONTAINERS from bci_tester.data import PYTHON_CONTAINERS +from bci_tester.data import PYTHON_MICRO_CONTAINERS from bci_tester.data import RELEASED_LTSS_VERSIONS from bci_tester.data import RMT_CONTAINERS from bci_tester.data import RUBY_CONTAINERS @@ -209,7 +210,10 @@ def _get_container_ref( for c in KIOSK_XORG_CLIENT_CONTAINERS ] + [(c, "nodejs", ImageType.LANGUAGE_STACK) for c in NODEJS_CONTAINERS] - + [(c, "python", ImageType.LANGUAGE_STACK) for c in PYTHON_CONTAINERS] + + [ + (c, "python", ImageType.LANGUAGE_STACK) + for c in PYTHON_CONTAINERS + PYTHON_MICRO_CONTAINERS + ] + [(c, "ruby", ImageType.LANGUAGE_STACK) for c in RUBY_CONTAINERS] + [(c, "base-fips", ImageType.OS) for c in BASE_FIPS_CONTAINERS] + [ diff --git a/tests/test_python.py b/tests/test_python.py index dcfa3eff..ff29cf4e 100644 --- a/tests/test_python.py +++ b/tests/test_python.py @@ -16,6 +16,7 @@ from bci_tester.data import OS_VERSION from bci_tester.data import PYTHON_CONTAINERS +from bci_tester.data import PYTHON_MICRO_CONTAINERS from bci_tester.data import PYTHON_WITH_PIPX_CONTAINERS from bci_tester.runtime_choice import PODMAN_SELECTED @@ -28,7 +29,7 @@ #: Base containers under test, input of auto_container fixture -CONTAINER_IMAGES = PYTHON_CONTAINERS +CONTAINER_IMAGES = PYTHON_CONTAINERS + PYTHON_MICRO_CONTAINERS #: Derived containers with the python http.server as CMD and a HEALTHCHECK @@ -47,7 +48,7 @@ marks=CONTAINER_T.marks, id=CONTAINER_T.id, ) - for CONTAINER_T in CONTAINER_IMAGES + for CONTAINER_T in PYTHON_CONTAINERS ] REQUESTS_CONTAINER_IMAGES = [ @@ -197,11 +198,16 @@ def test_tox(auto_container_per_test): @pytest.mark.skipif( - OS_VERSION == "16.0", reason="no packaged tox version available" + OS_VERSION in ["16.0", "16.1"], reason="no packaged tox version available" +) +@pytest.mark.parametrize( + "container_per_test", + PYTHON_CONTAINERS, + indirect=["container_per_test"], ) -def test_packaged_tox(auto_container_per_test): +def test_packaged_tox(container_per_test): """Ensure we can use the packaged tox version.""" - version = auto_container_per_test.connection.check_output( + version = container_per_test.connection.check_output( "echo $PYTHON_VERSION" ) if ( @@ -211,14 +217,19 @@ def test_packaged_tox(auto_container_per_test): ): pytest.skip("packaged tox not available") - auto_container_per_test.connection.check_output( + container_per_test.connection.check_output( f"zypper --non-interactive in {'python311' if version.startswith('3.11') else 'python3'}-tox && tox --version" ) -def test_pep517_wheels(auto_container_per_test): +@pytest.mark.parametrize( + "container_per_test", + PYTHON_CONTAINERS, + indirect=["container_per_test"], +) +def test_pep517_wheels(container_per_test): """Ensure we can use :command:`pip` to build PEP517 binary wheels""" - version = auto_container_per_test.connection.check_output( + version = container_per_test.connection.check_output( "echo $PYTHON_VERSION" ) if "3.12" in version and OS_VERSION not in ("tumbleweed",): @@ -232,7 +243,7 @@ def test_pep517_wheels(auto_container_per_test): if OS_VERSION in ("tumbleweed",): pip_install += " --break-system-packages --user" ujson_version = "5.10.0" - auto_container_per_test.connection.check_output( + container_per_test.connection.check_output( "zypper -n install gcc-c++ && " f"pip download --no-deps --no-binary :all: ujson=={ujson_version} && " f"tar --no-same-permissions --no-same-owner -xf ujson-{ujson_version}.tar.gz && " @@ -248,10 +259,15 @@ def test_pep517_wheels(auto_container_per_test): OS_VERSION == "tumbleweed", reason="pip --user not working due to PEP 668", ) -def test_pip_install_source_cryptography(auto_container_per_test): +@pytest.mark.parametrize( + "container_per_test", + PYTHON_CONTAINERS, + indirect=["container_per_test"], +) +def test_pip_install_source_cryptography(container_per_test): """Check that cryptography python module can be installed from source so that it is built against the SLE BCI FIPS enabled libopenssl.""" - version = auto_container_per_test.connection.check_output( + version = container_per_test.connection.check_output( "echo $PYTHON_VERSION" ) @@ -259,20 +275,20 @@ def test_pip_install_source_cryptography(auto_container_per_test): pytest.skip("cryptography tests only supported on >= 3.10") # install dependencies - auto_container_per_test.connection.run_expect( + container_per_test.connection.run_expect( [0], "zypper --non-interactive in cargo libffi-devel openssl-devel gcc tar gzip", ) # pin cryptography to a version that works with SLE BCI cryptography_version = "37.0.4" - auto_container_per_test.connection.run_expect( + container_per_test.connection.run_expect( [0], f"pip install --no-binary :all: cryptography=={cryptography_version}", ) # test cryptography - auto_container_per_test.connection.run_expect( + container_per_test.connection.run_expect( [0], f"""pip install cryptography-vectors=={cryptography_version} pytest && pip download --no-binary :all: cryptography=={cryptography_version} &&