blob: 481b3319a07f596292627ae0f3649ad2636c50f5 [file] [log] [blame]
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +03001import json
2import pytest
3
4
Oleksii Zhurba23c18332019-05-09 18:53:40 -05005@pytest.mark.smoke
6#move to sl?
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +03007def test_minions_status(local_salt_client):
8 result = local_salt_client.cmd(
9 tgt='salt:master',
10 param='salt-run manage.status timeout=10 --out=json',
11 expr_form='pillar', check_status=True)
12 statuses = {}
13 try:
Ekaterina Chernovac73bc4e2019-11-12 14:56:03 +030014 statuses = json.loads(list(result.values())[0])
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +030015 except Exception as e:
16 pytest.fail(
17 "Could not check the result: {}\n"
18 "Nodes status result: {}".format(e, result))
Dmitriy Kruglovbc0a88b2019-08-20 11:45:35 +020019 assert not statuses["down"], "Some minions are down:\n{}".format(
Hanna Arhipovae6ed8e42019-05-15 16:27:08 +030020 statuses["down"])