diff --git a/.github/workflows/ansible-test-plugins.yml b/.github/workflows/ansible-test-plugins.yml index 7c72ed5..42f2738 100644 --- a/.github/workflows/ansible-test-plugins.yml +++ b/.github/workflows/ansible-test-plugins.yml @@ -101,8 +101,8 @@ jobs: MYSQL_ROOT_PASSWORD: msandbox ports: - 3308:3306 - options: >- - --server_id 2 + volumes: + - tests/integration/setup_mysql/replica1:/etc/mysql/conf.d/ db_replica2: image: ${{ matrix.db_engine_version }} @@ -111,8 +111,8 @@ jobs: MYSQL_ROOT_PASSWORD: msandbox ports: - 3309:3306 - options: >- - --server_id 3 + volumes: + - tests/integration/setup_mysql/replica2:/etc/mysql/conf.d/ steps: - name: 'Wait 20s for the service containers to be healthy' diff --git a/Makefile b/Makefile index acb9545..bbc7768 100644 --- a/Makefile +++ b/Makefile @@ -17,8 +17,9 @@ test-integration: --network podman \ --publish 3308:3306 \ --health-cmd 'mysqladmin ping -P 3306 -pmsandbox | grep alive || exit 1' \ - mysql:8.0.22 \ - --server_id 2 + --security-opt label=disable \ + --volume ./tests/integration/targets/setup_mysql/replica1/:/etc/mysql/conf.d/ \ + mysql:8.0.22 podman run \ --detach \ --name replica2 \ @@ -27,8 +28,9 @@ test-integration: --network podman \ --publish 3309:3306 \ --health-cmd 'mysqladmin ping -P 3306 -pmsandbox | grep alive || exit 1' \ - mysql:8.0.22 \ - --server_id 3 + --security-opt label=disable \ + --volume ./tests/integration/targets/setup_mysql/replica2/:/etc/mysql/conf.d/ \ + mysql:8.0.22 while ! podman healthcheck run primary && [[ "$$SECONDS" -lt 120 ]]; do sleep 1; done -set -x; ansible-test integration -v --color --coverage --retry-on-error --continue-on-error --diff --docker --docker-network podman --python 3.8; set +x podman stop --time 0 --ignore primary diff --git a/tests/integration/targets/setup_mysql/replica1/mysql.cnf b/tests/integration/targets/setup_mysql/replica1/mysql.cnf new file mode 100644 index 0000000..8cb676b --- /dev/null +++ b/tests/integration/targets/setup_mysql/replica1/mysql.cnf @@ -0,0 +1,4 @@ +[mysqld] +skip-host-cache +skip-name-resolve +server_id = 2 diff --git a/tests/integration/targets/setup_mysql/replica2/mysql.cnf b/tests/integration/targets/setup_mysql/replica2/mysql.cnf new file mode 100644 index 0000000..c705476 --- /dev/null +++ b/tests/integration/targets/setup_mysql/replica2/mysql.cnf @@ -0,0 +1,4 @@ +[mysqld] +skip-host-cache +skip-name-resolve +server_id = 3