Ievgeniia Zadorozhna | ac85045 | 2019-01-27 22:31:38 +0300 | [diff] [blame] | 1 | import json |
| 2 | import pytest |
| 3 | |
| 4 | |
Oleksii Zhurba | 5b15b9b | 2019-05-09 18:53:40 -0500 | [diff] [blame] | 5 | @pytest.mark.smoke |
| 6 | #move to sl? |
Ievgeniia Zadorozhna | ac85045 | 2019-01-27 22:31:38 +0300 | [diff] [blame] | 7 | def test_minions_status(local_salt_client): |
| 8 | result = local_salt_client.cmd( |
Oleksii Zhurba | 4bfd2ee | 2019-04-10 21:56:58 -0500 | [diff] [blame] | 9 | tgt='salt:master', |
| 10 | param='salt-run manage.status timeout=10 --out=json', |
| 11 | expr_form='pillar', check_status=True) |
Ievgeniia Zadorozhna | ac85045 | 2019-01-27 22:31:38 +0300 | [diff] [blame] | 12 | statuses = {} |
| 13 | try: |
Ekaterina Chernova | e32e3f9 | 2019-11-12 14:56:03 +0300 | [diff] [blame] | 14 | statuses = json.loads(list(result.values())[0]) |
Ievgeniia Zadorozhna | ac85045 | 2019-01-27 22:31:38 +0300 | [diff] [blame] | 15 | except Exception as e: |
| 16 | pytest.fail( |
| 17 | "Could not check the result: {}\n" |
| 18 | "Nodes status result: {}".format(e, result)) |
Dmitriy Kruglov | a34a304 | 2019-08-20 11:45:35 +0200 | [diff] [blame] | 19 | assert not statuses["down"], "Some minions are down:\n{}".format( |
Ievgeniia Zadorozhna | ac85045 | 2019-01-27 22:31:38 +0300 | [diff] [blame] | 20 | statuses["down"]) |