summaryrefslogtreecommitdiff
path: root/openstackclient/tests
diff options
context:
space:
mode:
authorlihaijing <lihaijing@fiberhome.com>2017-09-19 10:05:16 +0800
committerlihaijing <lihaijing@fiberhome.com>2017-09-19 14:06:27 +0800
commit844623ccc47a8fc93f8e878376087b69396c4440 (patch)
tree523c4f308a63430e956cbf468a5580d1118a1152 /openstackclient/tests
parent39c00ab8b7a2c5ee8b82a26f779966806236dbc8 (diff)
downloadpython-openstackclient-844623ccc47a8fc93f8e878376087b69396c4440.tar.gz
Add "volume service list --host" functional test case
Change-Id: I467252d9fc6083fb891a8701d7992f16ce42556f
Diffstat (limited to 'openstackclient/tests')
-rw-r--r--openstackclient/tests/functional/volume/v2/test_service.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/openstackclient/tests/functional/volume/v2/test_service.py b/openstackclient/tests/functional/volume/v2/test_service.py
index 6986fde6..7ec43fe8 100644
--- a/openstackclient/tests/functional/volume/v2/test_service.py
+++ b/openstackclient/tests/functional/volume/v2/test_service.py
@@ -24,6 +24,7 @@ class VolumeServiceTests(common.BaseVolumeTests):
# Get the nonredundant services and hosts
services = list(set([x['Binary'] for x in cmd_output]))
+ hosts = list(set([x['Host'] for x in cmd_output]))
# Test volume service list --service
cmd_output = json.loads(self.openstack(
@@ -37,8 +38,17 @@ class VolumeServiceTests(common.BaseVolumeTests):
x['Binary']
)
- # TODO(zhiyong.dai): test volume service list --host after solving
- # https://bugs.launchpad.net/python-openstackclient/+bug/1664451
+ # Test volume service list --host
+ cmd_output = json.loads(self.openstack(
+ 'volume service list -f json ' +
+ '--host ' +
+ hosts[0]
+ ))
+ for x in cmd_output:
+ self.assertIn(
+ hosts[0],
+ x['Host']
+ )
def test_volume_service_set(self):