blob: 2117f6faf951feaa66dcf17ce0447a64d5365550 [file] [log] [blame]
Oleksii Zhurbae592ed12018-06-21 18:01:09 -05001import pytest
2
3
Oleksii Zhurbab9bf5452018-03-26 14:27:41 -05004def test_cinder_services(local_salt_client):
5 service_down = local_salt_client.cmd(
Oleksii Zhurbae592ed12018-06-21 18:01:09 -05006 'cinder:controller',
Oleksii Zhurbab9bf5452018-03-26 14:27:41 -05007 'cmd.run',
8 ['. /root/keystonerc; cinder service-list | grep "down\|disabled"'],
9 expr_form='pillar')
Oleksii Zhurbae592ed12018-06-21 18:01:09 -050010 if not service_down:
11 pytest.skip("Cinder is not found on this environment")
Oleksii Zhurbab9bf5452018-03-26 14:27:41 -050012 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 Zhurbae592ed12018-06-21 18:01:09 -050020 '''There are more than 1 host/backend for cinder'''