diff options
| author | Jenkins <jenkins@review.openstack.org> | 2017-06-05 20:10:56 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2017-06-05 20:10:56 +0000 |
| commit | c5524c80be4cd3e2443dc9539d1bf21eb3b8e297 (patch) | |
| tree | 50201851c1658f9596bd6e0ccb80184cb413dd7d /openstackclient/tests/functional/volume/v2 | |
| parent | adac738f17f4fbf261089f45544a72f63e3ddebe (diff) | |
| parent | 6aceca218af7d1d2c708fde48f1a5f2b798bc421 (diff) | |
| download | python-openstackclient-c5524c80be4cd3e2443dc9539d1bf21eb3b8e297.tar.gz | |
Merge "Replace "Display Name" by "Name" in volume list"
Diffstat (limited to 'openstackclient/tests/functional/volume/v2')
| -rw-r--r-- | openstackclient/tests/functional/volume/v2/test_volume.py | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/openstackclient/tests/functional/volume/v2/test_volume.py b/openstackclient/tests/functional/volume/v2/test_volume.py index 94ac792f..f936907c 100644 --- a/openstackclient/tests/functional/volume/v2/test_volume.py +++ b/openstackclient/tests/functional/volume/v2/test_volume.py @@ -90,7 +90,7 @@ class VolumeTests(common.BaseVolumeTests): 'volume list -f json ' + '--long' )) - names = [x["Display Name"] for x in cmd_output] + names = [x["Name"] for x in cmd_output] self.assertIn(name1, names) self.assertIn(name2, names) @@ -99,7 +99,7 @@ class VolumeTests(common.BaseVolumeTests): 'volume list -f json ' + '--status error' )) - names = [x["Display Name"] for x in cmd_output] + names = [x["Name"] for x in cmd_output] self.assertNotIn(name1, names) self.assertIn(name2, names) @@ -249,6 +249,37 @@ class VolumeTests(common.BaseVolumeTests): 'volume snapshot delete ' + snapshot_name) self.assertOutput('', raw_output) + def test_volume_list_backward_compatibility(self): + """Test backward compatibility of list command""" + name1 = uuid.uuid4().hex + cmd_output = json.loads(self.openstack( + 'volume create -f json ' + + '--size 1 ' + + name1 + )) + self.addCleanup(self.openstack, 'volume delete ' + name1) + self.assertEqual( + 1, + cmd_output["size"], + ) + self.wait_for("volume", name1, "available") + + # Test list -c "Display Name" + cmd_output = json.loads(self.openstack( + 'volume list -f json ' + + '-c "Display Name"' + )) + for each_volume in cmd_output: + self.assertIn('Display Name', each_volume) + + # Test list -c "Name" + cmd_output = json.loads(self.openstack( + 'volume list -f json ' + + '-c "Name"' + )) + for each_volume in cmd_output: + self.assertIn('Name', each_volume) + def wait_for(self, check_type, check_name, desired_status, wait=120, interval=5, failures=['ERROR']): status = "notset" |
