blob: f2d3c90300c0869ab4e632b411d26e5d3b311a44 [file] [log] [blame]
Ievgeniia Zadorozhna2f7a2a12019-10-10 15:57:09 +03001import pytest
2
3
4@pytest.mark.full
5@pytest.mark.usefixtures('check_ironic')
6@pytest.mark.usefixtures('check_openstack')
7def 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))