Ievgeniia Zadorozhna | ac85045 | 2019-01-27 22:31:38 +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 | 'salt:master', |
| 8 | 'cmd.run', |
| 9 | ['salt-run manage.status timeout=10 --out=json'], |
| 10 | expr_form='pillar') |
| 11 | statuses = {} |
| 12 | try: |
| 13 | statuses = json.loads(result.values()[0]) |
| 14 | except Exception as e: |
| 15 | pytest.fail( |
| 16 | "Could not check the result: {}\n" |
| 17 | "Nodes status result: {}".format(e, result)) |
| 18 | assert not statuses["down"], "Some minions are down:\n {}".format( |
| 19 | statuses["down"]) |