Skip to content

Commit c9b221d

Browse files
committed
Added mariadb migration tests for OS_VERSION 15.7 and 16.0
1 parent d5e9f6f commit c9b221d

3 files changed

Lines changed: 8 additions & 4 deletions

File tree

bci_tester/data.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -772,6 +772,7 @@ def create_BCI(
772772
_MARIADB_VERSION_OS_MATRIX: Tuple[Tuple[str, Tuple[str, ...]], ...] = (
773773
("10.11", ("15.6",)),
774774
("11.8", ("15.7",)),
775+
("11.8", ("16.0",)),
775776
("latest", ("tumbleweed",)),
776777
)
777778

tests/test_mariadb.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ def test_mariadb_healthcheck_galera_cluster_disabled(auto_container_per_test):
304304

305305
@pytest.mark.parametrize("ctr_image", MARIADB_CONTAINERS)
306306
@pytest.mark.skipif(
307-
OS_VERSION not in ("15.6",),
307+
OS_VERSION not in ("15.7", "16.0"),
308308
reason="MariaDB upgrade scenario not supported",
309309
)
310310
def test_mariadb_upgrade(
@@ -317,9 +317,12 @@ def test_mariadb_upgrade(
317317
mounts: List[Union[BindMount, ContainerVolume]] = [
318318
BindMount(host_path=tmp_path, container_path="/var/lib/mysql")
319319
]
320+
321+
# gosu was renamed to idexec from mariadb_version 10.11
322+
gosu = "gosu" if OS_VERSION == "15.6" else "idexec"
320323
mariadb_old = DerivedContainer(
321-
base="registry.suse.com/suse/mariadb:10.6",
322-
containerfile='RUN set -euo pipefail; head -n -1 /usr/local/bin/gosu > /tmp/gosu; echo \'exec setpriv --pdeathsig=keep --reuid="$u" --regid="$u" --clear-groups -- "$@"\' >> /tmp/gosu; mv /tmp/gosu /usr/local/bin/gosu; chmod +x /usr/local/bin/gosu',
324+
base="registry.suse.com/suse/mariadb:11.4",
325+
containerfile=f'RUN set -euo pipefail; head -n -1 /usr/local/bin/{gosu} > /tmp/{gosu}; echo \'exec setpriv --pdeathsig=keep --reuid="$u" --regid="$u" --clear-groups -- "$@"\' >> /tmp/{gosu}; mv /tmp/{gosu} /usr/local/bin/{gosu}; chmod +x /usr/local/bin/{gosu}',
323326
volume_mounts=mounts,
324327
extra_environment_variables=_DB_ENV,
325328
)

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ passenv =
4747
XDG_CONFIG_HOME
4848
XDG_RUNTIME_DIR
4949
commands =
50-
python -m pytest -vv tests/test_{envname}.py --junitxml={toxinidir}/junit_{envname}.xml --pytest-container-log-level=debug []
50+
python -m pytest -vv tests/test_{envname}.py::test_mariadb_upgrade --junitxml={toxinidir}/junit_{envname}.xml --pytest-container-log-level=debug []
5151

5252
[testenv:{py36,py39,py310,py311,py312,py313}-unit]
5353
commands =

0 commit comments

Comments
 (0)