Oleksii Zhurba | e592ed1 | 2018-06-21 18:01:09 -0500 | [diff] [blame^] | 1 | import pytest |
| 2 | |
| 3 | |
Oleksii Zhurba | b9bf545 | 2018-03-26 14:27:41 -0500 | [diff] [blame] | 4 | def test_cinder_services(local_salt_client): |
| 5 | service_down = local_salt_client.cmd( |
Oleksii Zhurba | e592ed1 | 2018-06-21 18:01:09 -0500 | [diff] [blame^] | 6 | 'cinder:controller', |
Oleksii Zhurba | b9bf545 | 2018-03-26 14:27:41 -0500 | [diff] [blame] | 7 | 'cmd.run', |
| 8 | ['. /root/keystonerc; cinder service-list | grep "down\|disabled"'], |
| 9 | expr_form='pillar') |
Oleksii Zhurba | e592ed1 | 2018-06-21 18:01:09 -0500 | [diff] [blame^] | 10 | if not service_down: |
| 11 | pytest.skip("Cinder is not found on this environment") |
Oleksii Zhurba | b9bf545 | 2018-03-26 14:27:41 -0500 | [diff] [blame] | 12 | cinder_volume = local_salt_client.cmd( |
| 13 | 'keystone:server', |
| 14 | 'cmd.run', |
| 15 | ['. /root/keystonerc; cinder service-list | grep "volume" | wc -l'], |
| 16 | expr_form='pillar') |
| 17 | assert service_down[service_down.keys()[0]] == '', \ |
| 18 | '''Some cinder services are in wrong state''' |
| 19 | assert cinder_volume[cinder_volume.keys()[0]] == '1', \ |
Oleksii Zhurba | e592ed1 | 2018-06-21 18:01:09 -0500 | [diff] [blame^] | 20 | '''There are more than 1 host/backend for cinder''' |