Skip to content

Added mariadb migration tests for OS_VERSION 15.7 and 16.0#908

Open
rcmadhankumar wants to merge 1 commit intoSUSE:mainfrom
rcmadhankumar:mariadb-migration
Open

Added mariadb migration tests for OS_VERSION 15.7 and 16.0#908
rcmadhankumar wants to merge 1 commit intoSUSE:mainfrom
rcmadhankumar:mariadb-migration

Conversation

@rcmadhankumar
Copy link
Contributor

[CI:TOXENVS] mariadb

base=mariadb_old_images.get(
OS_VERSION, "registry.suse.com/suse/mariadb:10.6"
),
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}',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't need that anymore for :10.11 ? can we remove that part alltogher?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what did you remove? the line is still there.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missed to push the latest code last time.
changes are pushed now.
(I removed tests for mariadb 10.x and switched to mariadb 11.x)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right but the gosu overwrite is still there. that should be removed for 11.4.

@rcmadhankumar rcmadhankumar force-pushed the mariadb-migration branch 3 times, most recently from 370fe8c to 840c93d Compare September 29, 2025 14:04
mariadb_old = DerivedContainer(
base="registry.suse.com/suse/mariadb:10.6",
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',
base=mariadb_old_images.get(OS_VERSION),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is always the same start image now - just hardcode it here rather than having that dict-lookup indirection?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hard coded.

Copy link
Member

@dirkmueller dirkmueller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs

--- a/tests/test_mariadb.py
+++ b/tests/test_mariadb.py
@@ -317,15 +317,8 @@ def test_mariadb_upgrade(
     mounts: List[Union[BindMount, ContainerVolume]] = [
         BindMount(host_path=tmp_path, container_path="/var/lib/mysql")
     ]
-    mariadb_old_images = {
-        "15.7": "registry.suse.com/suse/mariadb:11.4",
-        "16.0": "registry.suse.com/suse/mariadb:11.4",
-    }
-    # gosu was renamed to idexec from mariadb_version 10.11
-    gosu = "gosu" if OS_VERSION == "15.6" else "idexec"
     mariadb_old = DerivedContainer(
-        base=mariadb_old_images.get(OS_VERSION),
-        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}',
+        base="registry.suse.com/suse/mariadb:11.4",
         volume_mounts=mounts,
         extra_environment_variables=_DB_ENV,
     )

also, did you actually test the upgrade? it fails for me with OS_VERSION=16.0 tox -e mariadb -- -k upgrade

the new mariadb is not coming up:

DEBUG    pytest_container:container.py:1160 Launching container via: ['podman', 'run', '-d', '--cidfile=/tmp/dmueller/ab8708ba-2721-422a-a871-fc34c904cd73', '-e', 'MARIADB_USER=foo', '-e', 'MARIADB_PASSWORD=baz', '-e', 'MARIADB_DATABASE=bcitest', '-e', "MARIADB_ROOT_PASSWORD='88tpw-n!t-s$$cr`t!", '-e', 'MARIADB_AUTO_UPGRADE=1', '-v=/tmp/dmueller/pytest-of-dmueller/pytest-40/test_mariadb_upgrade_local_sus0:/var/lib/mysql:Z', '-it', 'registry.opensuse.org/devel/bci/16.0/containerfile/suse/mariadb:11.8']
DEBUG    pytest_container:container.py:1193 Started container with b9a58bbeff48368ed8420c430059324e5244c117f3a0422bce4e09c90e7a1bb4 at 2025-10-01 10:24:31.658486
DEBUG    testinfra:base.py:323 RUN CommandResult(backend=<testinfra.backend.podman.PodmanBackend object at 0x7f455c8316d0>, exit_status=1, command=b"podman exec b9a58bbeff48368ed8420c430059324e5244c117f3a0422bce4e09c90e7a1bb4 /bin/sh -c 'healthcheck.sh --connect'", _stdout=b'', _stderr=b"ERROR 2002 (HY000): Can't connect to local server through socket '/run/mysql/mysql.sock' (2)\nhealthcheck connect failed\n")
DEBUG    testinfra:base.py:323 RUN CommandResult(backend=<testinfra.backend.podman.PodmanBackend object at 0x7f455c8316d0>, exit_status=1, command=b"podman exec b9a58bbeff48368ed8420c430059324e5244c117f3a0422bce4e09c90e7a1bb4 /bin/sh -c 'healthcheck.sh --connect'", _stdout=b'', _stderr=b'healthcheck connect failed\n')
DEBUG    testinfra:base.py:323 RUN CommandResult(backend=<testinfra.backend.podman.PodmanBackend object at 0x7f455c8316d0>, exit_status=1, command=b"podman exec b9a58bbeff48368ed8420c430059324e5244c117f3a0422bce4e09c90e7a1bb4 /bin/sh -c 'healthcheck.sh --connect'", _stdout=b'', _stderr=b'healthcheck connect failed\n')
DEBUG    testinfra:base.py:323 RUN CommandResult(backend=<testinfra.backend.podman.PodmanBackend object at 0x7f455c8316d0>, exit_status=1, command=b"podman exec b9a58bbeff48368ed8420c430059324e5244c117f3a0422bce4e09c90e7a1bb4 /bin/sh -c 'healthcheck.sh --connect'", _stdout=b'', _stderr=b'healthcheck connect failed\n')
DEBUG    testinfra:base.py:323 RUN CommandResult(backend=<testinfra.backend.podman.PodmanBackend object at 0x7f455c8316d0>, exit_status=1, command=b"podman exec b9a58bbeff48368ed8420c430059324e5244c117f3a0422bce4e09c90e7a1bb4 /bin/sh -c 'healthcheck.sh --connect'", _stdout=b'', _stderr=b'healthcheck connect failed\n')

Copy link
Member

@dirkmueller dirkmueller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see prev comment

@rcmadhankumar rcmadhankumar force-pushed the mariadb-migration branch 2 times, most recently from 6fedd0c to c9b221d Compare October 13, 2025 09:02
@rcmadhankumar
Copy link
Contributor Author

SLE 16 tests are passing for me.

madhan@localhost:~/repo/mysql_migration/BCI-tests> export OS_VERSION=16.0
madhan@localhost:~/repo/mysql_migration/BCI-tests> tox -e mariadb -- -k upgrade
mariadb: commands[0]> python -m pytest -vv tests/test_mariadb.py --junitxml=/home/madhan/repo/mysql_migration/BCI-tests/junit_mariadb.xml --pytest-container-log-level=debug -k upgrade
===================================================================================== test session starts ======================================================================================
platform linux -- Python 3.13.7, pytest-8.4.2, pluggy-1.6.0 -- /home/madhan/repo/mysql_migration/BCI-tests/.tox/mariadb/bin/python
cachedir: .tox/mariadb/.pytest_cache
rootdir: /home/madhan/repo/mysql_migration/BCI-tests
configfile: pyproject.toml
plugins: xdist-3.8.0, testinfra-10.2.2, rerunfailures-16.0.1, pytest_container-0.4.4
collected 88 items / 84 deselected / 4 selected                                                                                                                                                

tests/test_mariadb.py::test_mariadb_upgrade[local-suse/mariadb:10.11 from registry.opensuse.org/devel/bci/16.0/containerfile/suse/mariadb:10.11] SKIPPED (This container is not
available for 16.0, only for 15.6)                                                                                                                                                       [ 25%]
tests/test_mariadb.py::test_mariadb_upgrade[local-suse/mariadb:11.8 from registry.opensuse.org/devel/bci/16.0/containerfile/suse/mariadb:11.8_0] SKIPPED (This container is not
available for 16.0, only for 15.7)                                                                                                                                                       [ 50%]
tests/test_mariadb.py::test_mariadb_upgrade[local-suse/mariadb:11.8 from registry.opensuse.org/devel/bci/16.0/containerfile/suse/mariadb:11.8_1] PASSED                                  [ 75%]
tests/test_mariadb.py::test_mariadb_upgrade[local-suse/mariadb:latest from registry.opensuse.org/devel/bci/16.0/containerfile/suse/mariadb:latest] SKIPPED (This container is not
available for 16.0, only for tumbleweed)                                                                                                                                                 [100%]

------------------------------------------------------ generated xml file: /home/madhan/repo/mysql_migration/BCI-tests/junit_mariadb.xml -------------------------------------------------------
========================================================================= 1 passed, 3 skipped, 84 deselected in 32.56s =========================================================================
  mariadb: OK (32.82=setup[0.03]+cmd[32.79] seconds)
  congratulations :) (32.87 seconds)

tox.ini Outdated
XDG_RUNTIME_DIR
commands =
python -m pytest -vv tests/test_{envname}.py --junitxml={toxinidir}/junit_{envname}.xml --pytest-container-log-level=debug []
python -m pytest -vv tests/test_{envname}.py::test_mariadb_upgrade --junitxml={toxinidir}/junit_{envname}.xml --pytest-container-log-level=debug []
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove this part.

Copy link
Member

@dirkmueller dirkmueller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see inline

@rcmadhankumar rcmadhankumar force-pushed the mariadb-migration branch 3 times, most recently from c55a0aa to 97041ce Compare February 25, 2026 06:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants