Added mariadb migration tests for OS_VERSION 15.7 and 16.0#908
Added mariadb migration tests for OS_VERSION 15.7 and 16.0#908rcmadhankumar wants to merge 1 commit intoSUSE:mainfrom
Conversation
tests/test_mariadb.py
Outdated
| 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}', |
There was a problem hiding this comment.
we don't need that anymore for :10.11 ? can we remove that part alltogher?
There was a problem hiding this comment.
what did you remove? the line is still there.
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
right but the gosu overwrite is still there. that should be removed for 11.4.
370fe8c to
840c93d
Compare
tests/test_mariadb.py
Outdated
| 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), |
There was a problem hiding this comment.
it is always the same start image now - just hardcode it here rather than having that dict-lookup indirection?
dirkmueller
left a comment
There was a problem hiding this comment.
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')
6fedd0c to
c9b221d
Compare
|
SLE 16 tests are passing for me. |
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 [] |
c55a0aa to
97041ce
Compare
97041ce to
82fee20
Compare
[CI:TOXENVS] mariadb