Commit Graph

11 Commits

Author SHA1 Message Date
James E. Blair 59e6d1228e Add option to use in-container pg_dump in tests
The pg_dump command is picky about client/server versions, so to
make it easier for developers to run tests locally using the pgsql
container, provida an option to use pg_dump from the container
instead of whatever version is installed locally, which may not
match.

Change-Id: I9add7af40b8f8d92a88d983eacbc59a01f0e7b9f
2023-10-19 17:40:16 -07:00
James E. Blair d6c0afb740 Revert "Test with MariaDB instead of MySQL"
This reverts commit 1c188ad440.

Reason for revert: This change increases test failures; investigation is ongoing.

Change-Id: I3a101656ee0904e1cf6c856dba845385c333260f
2023-04-13 13:38:13 +00:00
Clark Boylan 1c188ad440 Test with MariaDB instead of MySQL
I'm not sure if this is a good idea or not yet. Testing with MySQL
actually exposed the alembic transaction thing that is fixed in a
grandparent change. That said much of the world seems to be moving to
MariaDB so it might be a good idea for us to test that more explicitly?

We update bindep.txt which will install mariadb during CI job runs. We
also update our local test setup tooling to roughly match what will be
used in CI. For example the mariadb:10.6 docker image is chosen because
this is roughly equivalent to what Jammy packages.

Another good reason for this change is that Debian ARM64 does not
package MySQL and only packages MariaDB. This should give us better
compatibility for testing on architectures other than x86-64.

Change-Id: I9d00557ca5823da34278c3e9ecda2daaf13440b7
2023-04-05 08:39:34 -07:00
Simon Westphahl f653eecb97
Fix user creation in Docker test setup script
MySQL 8 no longer supports implicitly creating a user using the GRANT
statement. Use a separate CREATE USER statement instead.

ERROR 1064 (42000) at line 1: You have an error in your SQL syntax;
check the manual that corresponds to your MySQL server version for the
right syntax to use near 'identified by 'openstack_citest' WITH GRANT
OPTION' at line 1

Change-Id: I4cab4c1855d1ba97cbfc9dd0835b3d302d73aa62
2023-02-21 13:55:06 +01:00
Simon Westphahl 7b68214ea6 Run docker-compose up test setup script with env
When not using a ROOTCMD when running the test-setup-docker.sh the
script will fail with the following error message:

    ++ id -u
    + USER_ID=1000 docker-compose up -d
    ./test-setup-docker.sh: line 50: USER_ID=1000: command not found

Due to Bash's simple command expansion[0] variable assignments will be
interpreted as the command when no ROOTCMD is given. To work around this
we use default ROOTCMD to the `env` command.

[0]: https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html#Simple-Command-Expansion

Change-Id: Id696069a4eec2b2c2513ac449098b0ef73dc3906
2022-08-23 14:31:02 +02:00
Jeremy Stanley 90d7dcb1ed Update unit test container setup and instructions
Update the TESTING.rst file to reflect that just installing and
starting zookeeperd is no longer sufficient now that we require TLS
and auth for the connection, as well as running database servers.
Suggest the container-based setup script instead. Also improve that
script to allow it to be invoked as a normal user, with root command
escalation tool choice (e.g. "sudo") supplied through a ROOTCMD
environment variable, so that things created inside the git worktree
like the CA don't end up root-owned.

Related, the tox-docker plugin previously suggested in the document
is no longer a viable option for the same reasons, so clean up the
plumbing for it in tox.ini as well.

Change-Id: Iac32799425a5bd4b1bdbf56f34a2310241ac4499
2022-08-05 21:00:02 +00:00
Albin Vass 0cb099e1be Start zookeeper with users uid in test-setup-docker.sh
The zookeeper containers entrypoint will try to switch to the user
'zookeeper' if the container is started with uid '0'. This can cause issues
when the uid for the zookeeper user inside the container and the
users uid outside the container differ since it will lead to zookeeper
getting access denied when trying to read the certificates.

This also adds logging configuration to make it easier to debug
zookeeper in the future.

Change-Id: I51db53fe093a294e804148f682053123f54adfe1
2022-03-25 08:45:19 +01:00
James E. Blair 74a9c9de9b Use ZooKeeper TLS in tests
This mirrors the configuration in Nodepool for using TLS-enabled
ZooKeeper in tests.  We use the ensure-zookeeper role in order
to get a newer ZooKeeper than is supplied in bionic.

Change-Id: I14413fccbc9a6a7a75b6233d667e2a1d2856d894
2021-03-08 06:49:57 -08:00
Tristan Cacqueray 1f7d3a879b tests: use a more inclusive word for the default password
This change removes problematic language in the test environment.

Change-Id: I6f81ab68314902f0239babf887de04f8e30d8954
2020-07-09 13:38:20 +00:00
Tobias Henkel 2facdf1033
Support podman for test setup
Currently the docker based test setup requires the docker cli and
docker-compose. However on systems that only use podman this doesn't
work. While there is a docker cli wrapper for podman docker-compose
doesn't work together with podman. However there is also
podman-compose which supports the same docker-compose yaml files.

Thus adapt the script such that it finds either the docker or podman
executables and uses them.

Change-Id: I2d1c5e1713c51de376653b35266819fd380e8891
2019-12-13 12:42:59 +01:00
Tobias Henkel c493af1755
Add dockerized test setup
We currently have the test-setup.sh script that installs and
configures the services that are needed to run the zuul test
suite. However this needs mysql, postgres and zookeeper installed into
the system. It also messes with tmpfs mounts of zookeeper. This adds a
docker-compose based test setup that can ease the setup of the test
requirements on a developer machine.

Change-Id: Ib0e3f42898c6e9258625b03bcc363e91f4b7ee83
2019-02-15 07:54:28 +01:00