| from builtins import str |
| import pytest |
| |
| |
| @pytest.mark.sl_dup |
| #GaleraServiceDown |
| #TODO: a better test |
| @pytest.mark.full |
| def test_galera_cluster_status(local_salt_client): |
| gs = local_salt_client.cmd( |
| tgt='galera:*', |
| param='salt-call mysql.status | grep -A1 wsrep_cluster_size | tail -n1', |
| expr_form='pillar') |
| |
| if not gs: |
| pytest.skip("Galera service or galera:* pillar \ |
| are not found on this environment.") |
| |
| size_cluster = [] |
| amount = len(gs) |
| |
| for item in list(gs.values()): |
| size_cluster.append(item.split('\n')[-1].strip()) |
| |
| assert all(item == str(amount) for item in size_cluster), \ |
| '''There found inconsistency within cloud. MySQL galera cluster |
| is probably broken, the cluster size gathered from nodes: |
| {}'''.format(gs) |