|
34 | 34 |
|
35 | 35 | - assert:
|
36 | 36 | that:
|
37 |
| - - result is changed |
38 |
| - - result.queries == ["CHANGE MASTER TO MASTER_HOST='{{ mysql_host }}',MASTER_USER='{{ replication_user }}',MASTER_PASSWORD='********',MASTER_PORT={{ mysql_primary_port }},MASTER_LOG_FILE='{{ mysql_primary_status.File }}',MASTER_LOG_POS={{ mysql_primary_status.Position }} FOR CHANNEL '{{ test_channel }}'"] |
| 37 | + - result is changed |
| 38 | + - result.queries == result_query |
| 39 | + vars: |
| 40 | + result_query: ["CHANGE MASTER TO MASTER_HOST='{{ mysql_host }}',\ |
| 41 | + MASTER_USER='{{ replication_user }}',MASTER_PASSWORD='********',\ |
| 42 | + MASTER_PORT={{ mysql_primary_port }},MASTER_LOG_FILE=\ |
| 43 | + '{{ mysql_primary_status.File }}',MASTER_LOG_POS=\ |
| 44 | + {{ mysql_primary_status.Position }} FOR CHANNEL '{{ test_channel }}'"] |
39 | 45 |
|
40 | 46 | # Test startreplica mode:
|
41 | 47 | - name: Start replica with channel
|
|
48 | 54 |
|
49 | 55 | - assert:
|
50 | 56 | that:
|
51 |
| - - result is changed |
52 |
| - - result.queries == ["START SLAVE FOR CHANNEL '{{ test_channel }}'"] or result.queries == ["START REPLICA FOR CHANNEL '{{ test_channel }}'"] |
| 57 | + - result is changed |
| 58 | + - result.queries == result_query or result_query2 |
| 59 | + vars: |
| 60 | + result_query: ["START SLAVE FOR CHANNEL '{{ test_channel }}'"] |
| 61 | + result_query2: ["START REPLICA FOR CHANNEL '{{ test_channel }}'"] |
53 | 62 |
|
54 | 63 | # Test getreplica mode:
|
55 | 64 | - name: Get standby status with channel
|
|
62 | 71 |
|
63 | 72 | - assert:
|
64 | 73 | that:
|
65 |
| - - replica_status.Is_Replica == true |
66 |
| - - replica_status.Master_Host == '{{ mysql_host }}' |
67 |
| - - replica_status.Exec_Master_Log_Pos == mysql_primary_status.Position |
68 |
| - - replica_status.Master_Port == {{ mysql_primary_port }} |
69 |
| - - replica_status.Last_IO_Errno == 0 |
70 |
| - - replica_status.Last_IO_Error == '' |
71 |
| - - replica_status.Channel_Name == '{{ test_channel }}' |
72 |
| - - replica_status is not changed |
| 74 | + - replica_status.Is_Replica is truthy(convert_bool=True) |
| 75 | + - replica_status.Master_Host == mysql_host_value |
| 76 | + - replica_status.Exec_Master_Log_Pos == mysql_primary_status.Position |
| 77 | + - replica_status.Master_Port == mysql_primary_port_value |
| 78 | + - replica_status.Last_IO_Errno == 0 |
| 79 | + - replica_status.Last_IO_Error == '' |
| 80 | + - replica_status.Channel_Name == test_channel_value |
| 81 | + - replica_status is not changed |
| 82 | + vars: |
| 83 | + mysql_host_value: '{{ mysql_host }}' |
| 84 | + mysql_primary_port_value: '{{ mysql_primary_port }}' |
| 85 | + test_channel_value: '{{ test_channel }}' |
73 | 86 | when: mysql8022_and_higher == false
|
74 | 87 |
|
75 | 88 | - assert:
|
76 | 89 | that:
|
77 |
| - - replica_status.Is_Replica == true |
78 |
| - - replica_status.Source_Host == '{{ mysql_host }}' |
79 |
| - - replica_status.Exec_Source_Log_Pos == mysql_primary_status.Position |
80 |
| - - replica_status.Source_Port == {{ mysql_primary_port }} |
81 |
| - - replica_status.Last_IO_Errno == 0 |
82 |
| - - replica_status.Last_IO_Error == '' |
83 |
| - - replica_status.Channel_Name == '{{ test_channel }}' |
84 |
| - - replica_status is not changed |
| 90 | + - replica_status.Is_Replica is truthy(convert_bool=True) |
| 91 | + - replica_status.Source_Host == mysql_host_value |
| 92 | + - replica_status.Exec_Source_Log_Pos == mysql_primary_status.Position |
| 93 | + - replica_status.Source_Port == mysql_primary_port_value |
| 94 | + - replica_status.Last_IO_Errno == 0 |
| 95 | + - replica_status.Last_IO_Error == '' |
| 96 | + - replica_status.Channel_Name == test_channel_value |
| 97 | + - replica_status is not changed |
| 98 | + vars: |
| 99 | + mysql_host_value: '{{ mysql_host }}' |
| 100 | + mysql_primary_port_value: '{{ mysql_primary_port }}' |
| 101 | + test_channel_value: '{{ test_channel }}' |
85 | 102 | when: mysql8022_and_higher == true
|
86 | 103 |
|
87 | 104 |
|
|
96 | 113 |
|
97 | 114 | - assert:
|
98 | 115 | that:
|
99 |
| - - result is changed |
100 |
| - - result.queries == ["STOP SLAVE FOR CHANNEL '{{ test_channel }}'"] or result.queries == ["STOP REPLICA FOR CHANNEL '{{ test_channel }}'"] |
| 116 | + - result is changed |
| 117 | + - result.queries == result_query or result.queries == result_query2 |
| 118 | + vars: |
| 119 | + result_query: ["STOP SLAVE FOR CHANNEL '{{ test_channel }}'"] |
| 120 | + result_query2: ["STOP REPLICA FOR CHANNEL '{{ test_channel }}'"] |
101 | 121 |
|
102 | 122 | # Test reset
|
103 | 123 | - name: Reset replica with channel
|
|
110 | 130 |
|
111 | 131 | - assert:
|
112 | 132 | that:
|
113 |
| - - result is changed |
114 |
| - - result.queries == ["RESET SLAVE FOR CHANNEL '{{ test_channel }}'"] or result.queries == ["RESET REPLICA FOR CHANNEL '{{ test_channel }}'"] |
| 133 | + - result is changed |
| 134 | + - result.queries == result_query or result.queries == result_query2 |
| 135 | + vars: |
| 136 | + result_query: ["RESET SLAVE FOR CHANNEL '{{ test_channel }}'"] |
| 137 | + result_query2: ["RESET REPLICA FOR CHANNEL '{{ test_channel }}'"] |
115 | 138 |
|
116 | 139 | # Test reset all
|
117 | 140 | - name: Reset replica all with channel
|
|
124 | 147 |
|
125 | 148 | - assert:
|
126 | 149 | that:
|
127 |
| - - result is changed |
128 |
| - - result.queries == ["RESET SLAVE ALL FOR CHANNEL '{{ test_channel }}'"] or result.queries == ["RESET REPLICA ALL FOR CHANNEL '{{ test_channel }}'"] |
| 150 | + - result is changed |
| 151 | + - result.queries == result_query or result.queries == result_query2 |
| 152 | + vars: |
| 153 | + result_query: ["RESET SLAVE ALL FOR CHANNEL '{{ test_channel }}'"] |
| 154 | + result_query2: ["RESET REPLICA ALL FOR CHANNEL '{{ test_channel }}'"] |
0 commit comments