diff --git a/bci_tester/data.py b/bci_tester/data.py index eb477d37..c70a6c74 100755 --- a/bci_tester/data.py +++ b/bci_tester/data.py @@ -558,18 +558,30 @@ def create_BCI( create_BCI( build_tag=f"{APP_CONTAINER_PREFIX}/mariadb:{mariadb_ver}", bci_type=ImageType.APPLICATION, - available_versions=maria_versions, + available_versions=os_versions, forwarded_ports=[PortForwarding(container_port=3306)], extra_environment_variables={ "MARIADB_ROOT_PASSWORD": MARIADB_ROOT_PASSWORD }, ) - for mariadb_ver, maria_versions in ( + for mariadb_ver, os_versions in ( ("10.6", ("15.5", "15.6")), ("11.2", ("tumbleweed",)), ) ] +MARIADB_CLIENT_CONTAINERS = [ + create_BCI( + build_tag=f"{APP_CONTAINER_PREFIX}/mariadb-client:{mariadb_client_ver}", + bci_type=ImageType.APPLICATION, + available_versions=os_versions, + custom_entry_point="/bin/sh", + ) + for mariadb_client_ver, os_versions in ( + ("10.6", ("15.5", "15.6")), + ("11.2", ("tumbleweed",)), + ) +] POSTGRES_PASSWORD = "n0ts3cr3t" diff --git a/pyproject.toml b/pyproject.toml index de9aa7d2..efe13a59 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -70,6 +70,8 @@ markers = [ 'golang_stable-openssl', 'mariadb_10.6', 'mariadb_11.2', + 'mariadb-client_10.6', + 'mariadb-client_11.2', 'nodejs_16', 'nodejs_18', 'nodejs_20', diff --git a/tests/test_mariadb.py b/tests/test_mariadb.py index e6129729..216eaf77 100644 --- a/tests/test_mariadb.py +++ b/tests/test_mariadb.py @@ -13,6 +13,7 @@ from tenacity import stop_after_attempt from tenacity import wait_exponential +from bci_tester.data import MARIADB_CLIENT_CONTAINERS from bci_tester.data import MARIADB_CONTAINERS from bci_tester.data import MARIADB_ROOT_PASSWORD @@ -136,3 +137,14 @@ def wait_for_db_to_start(): with conn.cursor() as cur: cur.execute("SELECT * FROM test;") assert cur.fetchone() == (1, 100, "abc'def") + + +@pytest.mark.parametrize( + "container_per_test", + MARIADB_CLIENT_CONTAINERS, + indirect=["container_per_test"], +) +def test_mariadb_client(container_per_test: ContainerData) -> None: + assert "MariaDB" in container_per_test.connection.check_output( + "mysql --version" + )