mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-07-26 06:31:27 -07:00
* Add changes from stable-1 integrations tests (PR 418)
* Refactor to use connectors' info declared in setup_mysql
* Fix 2nd replication stop marked changed by mysqlclient
(cherry picked from commit 61586ae4cc
)
This commit is contained in:
parent
13a8a4ebff
commit
8968f51533
15 changed files with 61 additions and 38 deletions
|
@ -45,12 +45,12 @@
|
|||
- assert:
|
||||
that:
|
||||
- result is failed
|
||||
when: connector.name.0 is search('pymysql')
|
||||
when: connector_name is search('pymysql')
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- result is succeeded
|
||||
when: connector.name.0 is not search('pymysql')
|
||||
when: connector_name is not search('pymysql')
|
||||
|
||||
- name: attempt connection with newly created user ignoring hostname
|
||||
mysql_replication:
|
||||
|
|
|
@ -176,8 +176,8 @@
|
|||
shell: "echo \"INSERT INTO {{ test_table }} (id) VALUES (1), (2), (3); FLUSH LOGS;\" | {{ mysql_command }} -P{{ mysql_primary_port }} {{ test_db }}"
|
||||
|
||||
- name: Small pause to be sure the bin log, which was flushed previously, reached the replica
|
||||
pause:
|
||||
seconds: 2
|
||||
ansible.builtin.wait_for:
|
||||
timeout: 2
|
||||
|
||||
# Test primary log pos has been changed:
|
||||
- name: Get replica status
|
||||
|
@ -210,10 +210,12 @@
|
|||
fail_on_error: true
|
||||
register: result
|
||||
|
||||
# mysqlclient 2.0.1 always return "changed"
|
||||
- assert:
|
||||
that:
|
||||
- result is not changed
|
||||
when: (pymysql_version.stdout | default('1000', true)) is version('0.9.3', '<=')
|
||||
- result is not changed
|
||||
when:
|
||||
- connector_name == 'pymysql'
|
||||
|
||||
# Test stopreplica mode:
|
||||
- name: Stop replica using deprecated stopslave choice
|
||||
|
@ -228,7 +230,12 @@
|
|||
- result is changed
|
||||
- result.queries == ["STOP SLAVE"] or result.queries == ["STOP REPLICA"]
|
||||
|
||||
- name: Pause for 2 seconds to let the replication stop
|
||||
ansible.builtin.wait_for:
|
||||
timeout: 2
|
||||
|
||||
# Test stopreplica mode:
|
||||
# mysqlclient 2.0.1 always return "changed"
|
||||
- name: Stop replica that is no longer running
|
||||
mysql_replication:
|
||||
<<: *mysql_params
|
||||
|
@ -239,5 +246,6 @@
|
|||
|
||||
- assert:
|
||||
that:
|
||||
- result is not changed
|
||||
when: (pymysql_version.stdout | default('1000', true)) is version('0.9.3', '<=')
|
||||
- result is not changed
|
||||
when:
|
||||
- connector_name == 'pymysql'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue