Skip to content

Commit 844623c

Browse files
committed
Add "volume service list --host" functional test case
Change-Id: I467252d9fc6083fb891a8701d7992f16ce42556f
1 parent 39c00ab commit 844623c

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

openstackclient/tests/functional/volume/v2/test_service.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ def test_volume_service_list(self):
2424

2525
# Get the nonredundant services and hosts
2626
services = list(set([x['Binary'] for x in cmd_output]))
27+
hosts = list(set([x['Host'] for x in cmd_output]))
2728

2829
# Test volume service list --service
2930
cmd_output = json.loads(self.openstack(
@@ -37,8 +38,17 @@ def test_volume_service_list(self):
3738
x['Binary']
3839
)
3940

40-
# TODO(zhiyong.dai): test volume service list --host after solving
41-
# https://bugs.launchpad.net/python-openstackclient/+bug/1664451
41+
# Test volume service list --host
42+
cmd_output = json.loads(self.openstack(
43+
'volume service list -f json ' +
44+
'--host ' +
45+
hosts[0]
46+
))
47+
for x in cmd_output:
48+
self.assertIn(
49+
hosts[0],
50+
x['Host']
51+
)
4252

4353
def test_volume_service_set(self):
4454

0 commit comments

Comments
 (0)