blob: d2b2d5f7d7316ad8ec8ad7b9ecbb36a572bde240 [file] [log] [blame]
Oleksii Zhurbaa10927b2017-09-27 22:09:23 +00001def test_galera_cluster_status(local_salt_client):
2 gs = local_salt_client.cmd(
3 'I@galera:*',
4 'cmd.run',
5 ['salt-call mysql.status | grep -A1 wsrep_cluster_size | tail -n1'],
6 expr_form='pillar')
7
8 size_cluster = []
9 amount = len(gs)
10
11 for item in gs.values():
12 size_cluster.append(item.split('\n')[-1].strip())
13
14 assert all(item == str(amount) for item in size_cluster), \
15 '''There found inconsistency within cloud. MySQL galera cluster
16 is probably broken, the cluster size gathered from nodes:
17 {}'''.format(gs)