Ievgeniia Zadorozhna | 2f7a2a1 | 2019-10-10 15:57:09 +0300 | [diff] [blame] | 1 | import pytest |
| 2 | |
| 3 | |
| 4 | @pytest.mark.full |
| 5 | @pytest.mark.usefixtures('check_ironic') |
| 6 | @pytest.mark.usefixtures('check_openstack') |
| 7 | def test_ironic_nodes_are_available_or_active(local_salt_client): |
| 8 | """ |
| 9 | Make sure that ironic nodes are available or active - check that all |
| 10 | nodes have 'active' or 'available' state in output of |
| 11 | `openstack baremetal node list` on 'keystone:server' nodes. |
| 12 | The other states are not expected. See full states description: |
| 13 | https://docs.openstack.org/ironic/latest/contributor/states.html |
| 14 | """ |
| 15 | result = local_salt_client.cmd_any( |
| 16 | tgt='keystone:server', |
| 17 | param='. /root/keystonercv3; openstack baremetal node list | ' |
| 18 | 'grep -v "\-------\|UUID\|active\|available"') |
| 19 | assert result == '', ( |
| 20 | "Some Ironic nodes are in wrong state:\n{}".format(result)) |