From 0f5c408402c29b16995a38740aae620df0d4e626 Mon Sep 17 00:00:00 2001 From: Eric Harney Date: Fri, 24 Mar 2017 15:24:39 -0400 Subject: [PATCH] Don't use tempest special_fields This has been removed, which now causes these tests to fail. Tempest change: https://review.openstack.org/#/c/448869/ Change-Id: I31310dc9b3834e0bf16618db3e473f17eab2b610 (cherry picked from commit 39c7165e33ccbb6e2f4bee63cac9e4cbcb7ba23c) --- .../tempest/api/volume/test_consistencygroups.py | 12 ++++-------- .../tests/tempest/api/volume/test_volume_unicode.py | 7 +++---- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/cinder/tests/tempest/api/volume/test_consistencygroups.py b/cinder/tests/tempest/api/volume/test_consistencygroups.py index c52cdf845..79f498d9f 100644 --- a/cinder/tests/tempest/api/volume/test_consistencygroups.py +++ b/cinder/tests/tempest/api/volume/test_consistencygroups.py @@ -79,8 +79,7 @@ class ConsistencyGroupsV2Test(base.BaseVolumeAdminTest): cg = create_consistencygroup(volume_type['id'], name=cg_name)['consistencygroup'] vol_name = data_utils.rand_name("volume") - self.name_field = self.special_fields['name_field'] - params = {self.name_field: vol_name, + params = {'name': vol_name, 'volume_type': volume_type['id'], 'consistencygroup_id': cg['id'], 'size': CONF.volume.volume_size} @@ -123,8 +122,7 @@ class ConsistencyGroupsV2Test(base.BaseVolumeAdminTest): cg = create_consistencygroup(volume_type['id'], name=cg_name)['consistencygroup'] vol_name = data_utils.rand_name("volume") - self.name_field = self.special_fields['name_field'] - params = {self.name_field: vol_name, + params = {'name': vol_name, 'volume_type': volume_type['id'], 'consistencygroup_id': cg['id'], 'size': CONF.volume.volume_size} @@ -183,8 +181,7 @@ class ConsistencyGroupsV2Test(base.BaseVolumeAdminTest): cg = create_consistencygroup(volume_type['id'], name=cg_name)['consistencygroup'] vol_name = data_utils.rand_name("volume") - self.name_field = self.special_fields['name_field'] - params = {self.name_field: vol_name, + params = {'name': vol_name, 'volume_type': volume_type['id'], 'consistencygroup_id': cg['id'], 'size': CONF.volume.volume_size} @@ -249,8 +246,7 @@ class ConsistencyGroupsV2Test(base.BaseVolumeAdminTest): cg = create_consistencygroup(volume_type['id'], name=cg_name)['consistencygroup'] vol_name = data_utils.rand_name("volume") - self.name_field = self.special_fields['name_field'] - params = {self.name_field: vol_name, + params = {'name': vol_name, 'volume_type': volume_type['id'], 'consistencygroup_id': cg['id'], 'size': CONF.volume.volume_size} diff --git a/cinder/tests/tempest/api/volume/test_volume_unicode.py b/cinder/tests/tempest/api/volume/test_volume_unicode.py index 6d3cc4f4a..44dadf4a0 100644 --- a/cinder/tests/tempest/api/volume/test_volume_unicode.py +++ b/cinder/tests/tempest/api/volume/test_volume_unicode.py @@ -36,10 +36,9 @@ class CinderUnicodeTest(volume_base.BaseVolumeTest): @classmethod def create_volume_with_args(cls, **kwargs): - name = kwargs['name'] or data_utils.rand_name('Volume') + if 'name' not in kwargs: + kwargs['name'] = data_utils.rand_name('Volume') - name_field = cls.special_fields['name_field'] - kwargs[name_field] = name kwargs['size'] = CONF.volume.volume_size volume = cls.volumes_client.create_volume(**kwargs)['volume'] @@ -56,5 +55,5 @@ class CinderUnicodeTest(volume_base.BaseVolumeTest): result = self.volumes_client.show_volume(self.volumes[0]['id']) fetched_volume = result['volume'] - self.assertEqual(fetched_volume[self.special_fields['name_field']], + self.assertEqual(fetched_volume['name'], self.volume_name)