Skip to content

Commit

Permalink
Fix integration test for CHANGE MASTER
Browse files Browse the repository at this point in the history
  • Loading branch information
laurent-indermuehle committed Jul 23, 2024
1 parent cb96b32 commit 6243cce
Showing 1 changed file with 18 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,25 @@
master_log_pos: '{{ master_status.Position }}'
register: result

- assert:
- name: Assert that changemaster is changed and query matchs for MariaDB and MySQL < 8.0.23
ansible.builtin.assert:
that:
- result is changed
- result.queries[0] is match("CHANGE MASTER ('\S+' )?TO MASTER_HOST='[0-9.]+',MASTER_USER='\w+',MASTER_PASSWORD='[*]{8}',MASTER_PORT=\d+,MASTER_LOG_FILE='mysql-bin.000001',MASTER_LOG_POS=\d+")
- result is changed
- result.queries[0] is match("CHANGE MASTER ('\S+' )?TO MASTER_HOST='[0-9.]+',MASTER_USER='\w+',MASTER_PASSWORD='[*]{8}',MASTER_PORT=\d+,MASTER_LOG_FILE='mysql-bin.000001',MASTER_LOG_POS=\d+")
when:
- >
db_engine == 'mariadb' or
db_engine == 'mysql' and db_version is version('8.0.23', '<')
- name: Assert that changemaster is changed and query matchs for MariaDB and MySQL >= 8.0.23
ansible.builtin.assert:
that:
- result is changed
- result.queries[0] is match("CHANGE REPLICATION SOURCE ('\S+' )?TO MASTER_HOST='[0-9.]+',MASTER_USER='\w+',MASTER_PASSWORD='[*]{8}',MASTER_PORT=\d+,MASTER_LOG_FILE='mysql-bin.000001',MASTER_LOG_POS=\d+")
when:
- >
db_engine == 'mariadb' or
db_engine == 'mysql' and db_version is version('8.0.23', '>=')
# Test startslave mode:
- name: Start slave
Expand Down

0 comments on commit 6243cce

Please sign in to comment.