blob: 687f3ae7798faa859fa91259e8a6961322e429da [file] [log] [blame]
Ievgeniia Zadorozhnaac850452019-01-27 22:31:38 +03001import json
2import pytest
3
4
5def test_minions_status(local_salt_client):
6 result = local_salt_client.cmd(
Oleksii Zhurba4bfd2ee2019-04-10 21:56:58 -05007 tgt='salt:master',
8 param='salt-run manage.status timeout=10 --out=json',
9 expr_form='pillar', check_status=True)
Ievgeniia Zadorozhnaac850452019-01-27 22:31:38 +030010 statuses = {}
11 try:
12 statuses = json.loads(result.values()[0])
13 except Exception as e:
14 pytest.fail(
15 "Could not check the result: {}\n"
16 "Nodes status result: {}".format(e, result))
17 assert not statuses["down"], "Some minions are down:\n {}".format(
18 statuses["down"])