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