Hanna Arhipova | e6ed8e4 | 2019-05-15 16:27:08 +0300 | [diff] [blame] | 1 | import json |
| 2 | import pytest |
| 3 | |
| 4 | |
| 5 | def test_minions_status(local_salt_client): |
| 6 | result = local_salt_client.cmd( |
| 7 | tgt='salt:master', |
| 8 | param='salt-run manage.status timeout=10 --out=json', |
| 9 | expr_form='pillar', check_status=True) |
| 10 | 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"]) |