Use classname as prefix of volume name
Sometimes volume may not be cleaned properly and from its name
(such as tempest-Volume-245831117) it is difficult to know which
testcase created it. This is to use classname as prefix of volume
name.
Change-Id: Ic0e376098caa0c46473d92f6d043ab85fbbaee8c
diff --git a/tempest/api/compute/admin/test_servers.py b/tempest/api/compute/admin/test_servers.py
old mode 100644
new mode 100755
index 09253b0..0498d3b
--- a/tempest/api/compute/admin/test_servers.py
+++ b/tempest/api/compute/admin/test_servers.py
@@ -37,12 +37,12 @@
def resource_setup(cls):
super(ServersAdminTestJSON, cls).resource_setup()
- cls.s1_name = data_utils.rand_name('server')
+ cls.s1_name = data_utils.rand_name(cls.__name__ + '-server')
server = cls.create_test_server(name=cls.s1_name,
wait_until='ACTIVE')
cls.s1_id = server['id']
- cls.s2_name = data_utils.rand_name('server')
+ cls.s2_name = data_utils.rand_name(cls.__name__ + '-server')
server = cls.create_test_server(name=cls.s2_name,
wait_until='ACTIVE')
cls.s2_id = server['id']
@@ -103,7 +103,7 @@
@test.idempotent_id('86c7a8f7-50cf-43a9-9bac-5b985317134f')
def test_list_servers_filter_by_exist_host(self):
# Filter the list of servers by existent host
- name = data_utils.rand_name('server')
+ name = data_utils.rand_name(self.__class__.__name__ + '-server')
network = self.get_tenant_network()
network_kwargs = fixed_network.set_networks_kwarg(network)
# We need to create the server as an admin, so we can't use
diff --git a/tempest/api/compute/admin/test_servers_negative.py b/tempest/api/compute/admin/test_servers_negative.py
old mode 100644
new mode 100755
index 7437c14..5ff5d58
--- a/tempest/api/compute/admin/test_servers_negative.py
+++ b/tempest/api/compute/admin/test_servers_negative.py
@@ -40,7 +40,7 @@
super(ServersAdminNegativeTestJSON, cls).resource_setup()
cls.tenant_id = cls.client.tenant_id
- cls.s1_name = data_utils.rand_name('server')
+ cls.s1_name = data_utils.rand_name(cls.__name__ + '-server')
server = cls.create_test_server(name=cls.s1_name,
wait_until='ACTIVE')
cls.s1_id = server['id']
diff --git a/tempest/api/compute/images/test_list_image_filters.py b/tempest/api/compute/images/test_list_image_filters.py
old mode 100644
new mode 100755
index 9017461..c0caa52
--- a/tempest/api/compute/images/test_list_image_filters.py
+++ b/tempest/api/compute/images/test_list_image_filters.py
@@ -60,7 +60,7 @@
def _create_image():
params = {
- 'name': data_utils.rand_name('image'),
+ 'name': data_utils.rand_name(cls.__name__ + '-image'),
'container_format': 'bare',
'disk_format': 'raw'
}
diff --git a/tempest/api/compute/servers/test_create_server.py b/tempest/api/compute/servers/test_create_server.py
old mode 100644
new mode 100755
index da9d548..e8df52d
--- a/tempest/api/compute/servers/test_create_server.py
+++ b/tempest/api/compute/servers/test_create_server.py
@@ -48,7 +48,7 @@
cls.meta = {'hello': 'world'}
cls.accessIPv4 = '1.1.1.1'
cls.accessIPv6 = '0000:0000:0000:0000:0000:babe:220.12.22.2'
- cls.name = data_utils.rand_name('server')
+ cls.name = data_utils.rand_name(cls.__name__ + '-server')
cls.password = data_utils.rand_password()
disk_config = cls.disk_config
cls.server_initial = cls.create_test_server(
diff --git a/tempest/api/compute/servers/test_server_actions.py b/tempest/api/compute/servers/test_server_actions.py
old mode 100644
new mode 100755
index 21e7d10..4a5bab5
--- a/tempest/api/compute/servers/test_server_actions.py
+++ b/tempest/api/compute/servers/test_server_actions.py
@@ -155,7 +155,7 @@
def test_rebuild_server(self):
# The server should be rebuilt using the provided image and data
meta = {'rebuild': 'server'}
- new_name = data_utils.rand_name('server')
+ new_name = data_utils.rand_name(self.__class__.__name__ + '-server')
password = 'rebuildPassw0rd'
rebuilt_server = self.client.rebuild_server(
self.server_id,
diff --git a/tempest/api/compute/servers/test_servers.py b/tempest/api/compute/servers/test_servers.py
old mode 100644
new mode 100755
index e91857a..5aeba4e
--- a/tempest/api/compute/servers/test_servers.py
+++ b/tempest/api/compute/servers/test_servers.py
@@ -52,7 +52,8 @@
# Creating a server with a name that already exists is allowed
# TODO(sdague): clear out try, we do cleanup one layer up
- server_name = data_utils.rand_name('server')
+ server_name = data_utils.rand_name(
+ self.__class__.__name__ + '-server')
server = self.create_test_server(name=server_name,
wait_until='ACTIVE')
id1 = server['id']
diff --git a/tempest/api/compute/servers/test_servers_negative.py b/tempest/api/compute/servers/test_servers_negative.py
old mode 100644
new mode 100755
index 10ea31d..2304cb7
--- a/tempest/api/compute/servers/test_servers_negative.py
+++ b/tempest/api/compute/servers/test_servers_negative.py
@@ -253,7 +253,8 @@
# Update name of a non-existent server
nonexistent_server = data_utils.rand_uuid()
- new_name = data_utils.rand_name('server') + '_updated'
+ new_name = data_utils.rand_name(
+ self.__class__.__name__ + '-server') + '_updated'
self.assertRaises(lib_exc.NotFound, self.client.update_server,
nonexistent_server, name=new_name)
diff --git a/tempest/api/compute/volumes/test_volume_snapshots.py b/tempest/api/compute/volumes/test_volume_snapshots.py
old mode 100644
new mode 100755
index f42d153..e96982d
--- a/tempest/api/compute/volumes/test_volume_snapshots.py
+++ b/tempest/api/compute/volumes/test_volume_snapshots.py
@@ -40,14 +40,14 @@
@test.idempotent_id('cd4ec87d-7825-450d-8040-6e2068f2da8f')
def test_volume_snapshot_create_get_list_delete(self):
- v_name = data_utils.rand_name('Volume')
+ v_name = data_utils.rand_name(self.__class__.__name__ + '-Volume')
volume = self.volumes_client.create_volume(
size=CONF.volume.volume_size,
display_name=v_name)['volume']
self.addCleanup(self.delete_volume, volume['id'])
waiters.wait_for_volume_status(self.volumes_client, volume['id'],
'available')
- s_name = data_utils.rand_name('Snapshot')
+ s_name = data_utils.rand_name(self.__class__.__name__ + '-Snapshot')
# Create snapshot
snapshot = self.snapshots_client.create_snapshot(
volume_id=volume['id'],
diff --git a/tempest/api/compute/volumes/test_volumes_get.py b/tempest/api/compute/volumes/test_volumes_get.py
old mode 100644
new mode 100755
index c276fe0..d599431
--- a/tempest/api/compute/volumes/test_volumes_get.py
+++ b/tempest/api/compute/volumes/test_volumes_get.py
@@ -42,7 +42,7 @@
@test.idempotent_id('f10f25eb-9775-4d9d-9cbe-1cf54dae9d5f')
def test_volume_create_get_delete(self):
# CREATE, GET, DELETE Volume
- v_name = data_utils.rand_name('Volume')
+ v_name = data_utils.rand_name(self.__class__.__name__ + '-Volume')
metadata = {'Type': 'work'}
# Create volume
volume = self.client.create_volume(size=CONF.volume.volume_size,
diff --git a/tempest/api/compute/volumes/test_volumes_list.py b/tempest/api/compute/volumes/test_volumes_list.py
old mode 100644
new mode 100755
index f709c91..c60fcca
--- a/tempest/api/compute/volumes/test_volumes_list.py
+++ b/tempest/api/compute/volumes/test_volumes_list.py
@@ -48,7 +48,7 @@
cls.volume_list = []
cls.volume_id_list = []
for i in range(3):
- v_name = data_utils.rand_name('volume')
+ v_name = data_utils.rand_name(cls.__name__ + '-volume')
metadata = {'Type': 'work'}
try:
volume = cls.client.create_volume(size=CONF.volume.volume_size,
diff --git a/tempest/api/compute/volumes/test_volumes_negative.py b/tempest/api/compute/volumes/test_volumes_negative.py
old mode 100644
new mode 100755
index 92f5ea8..7ecad12
--- a/tempest/api/compute/volumes/test_volumes_negative.py
+++ b/tempest/api/compute/volumes/test_volumes_negative.py
@@ -59,7 +59,7 @@
def test_create_volume_with_invalid_size(self):
# Negative: Should not be able to create volume with invalid size
# in request
- v_name = data_utils.rand_name('Volume')
+ v_name = data_utils.rand_name(self.__class__.__name__ + '-Volume')
metadata = {'Type': 'work'}
self.assertRaises(lib_exc.BadRequest, self.client.create_volume,
size='#$%', display_name=v_name, metadata=metadata)
@@ -69,7 +69,7 @@
def test_create_volume_with_out_passing_size(self):
# Negative: Should not be able to create volume without passing size
# in request
- v_name = data_utils.rand_name('Volume')
+ v_name = data_utils.rand_name(self.__class__.__name__ + '-Volume')
metadata = {'Type': 'work'}
self.assertRaises(lib_exc.BadRequest, self.client.create_volume,
size='', display_name=v_name, metadata=metadata)
@@ -78,7 +78,7 @@
@test.idempotent_id('8cce995e-0a83-479a-b94d-e1e40b8a09d1')
def test_create_volume_with_size_zero(self):
# Negative: Should not be able to create volume with size zero
- v_name = data_utils.rand_name('Volume')
+ v_name = data_utils.rand_name(self.__class__.__name__ + '-Volume')
metadata = {'Type': 'work'}
self.assertRaises(lib_exc.BadRequest, self.client.create_volume,
size='0', display_name=v_name, metadata=metadata)
diff --git a/tempest/api/image/base.py b/tempest/api/image/base.py
old mode 100644
new mode 100755
index 6fd6ea6..78e53b4
--- a/tempest/api/image/base.py
+++ b/tempest/api/image/base.py
@@ -167,7 +167,7 @@
return image_ids
def _create_image(self):
- name = data_utils.rand_name('image')
+ name = data_utils.rand_name(self.__class__.__name__ + '-image')
image = self.client.create_image(name=name,
container_format='bare',
disk_format='raw')
diff --git a/tempest/api/volume/admin/test_multi_backend.py b/tempest/api/volume/admin/test_multi_backend.py
index b7c4236..f665e69 100644
--- a/tempest/api/volume/admin/test_multi_backend.py
+++ b/tempest/api/volume/admin/test_multi_backend.py
@@ -55,8 +55,8 @@
@classmethod
def _create_type_and_volume(cls, backend_name_key, with_prefix):
# Volume/Type creation
- type_name = data_utils.rand_name('Type')
- vol_name = data_utils.rand_name('Volume')
+ type_name = data_utils.rand_name(cls.__name__ + '-Type')
+ vol_name = data_utils.rand_name(cls.__name__ + '-Volume')
spec_key_with_prefix = "capabilities:volume_backend_name"
spec_key_without_prefix = "volume_backend_name"
if with_prefix:
diff --git a/tempest/api/volume/admin/test_qos.py b/tempest/api/volume/admin/test_qos.py
old mode 100644
new mode 100755
index 9402668..f1101e1
--- a/tempest/api/volume/admin/test_qos.py
+++ b/tempest/api/volume/admin/test_qos.py
@@ -37,7 +37,7 @@
read_iops_sec='2000')
def _create_delete_test_qos_with_given_consumer(self, consumer):
- name = utils.rand_name('qos')
+ name = utils.rand_name(self.__class__.__name__ + '-qos')
qos = {'name': name, 'consumer': consumer}
body = self.create_test_qos_specs(name, consumer)
for key in ['name', 'consumer']:
diff --git a/tempest/api/volume/admin/test_volume_types.py b/tempest/api/volume/admin/test_volume_types.py
old mode 100644
new mode 100755
index 8eae085..01f96b7
--- a/tempest/api/volume/admin/test_volume_types.py
+++ b/tempest/api/volume/admin/test_volume_types.py
@@ -35,7 +35,7 @@
def test_volume_crud_with_volume_type_and_extra_specs(self):
# Create/update/get/delete volume with volume_type and extra spec.
volume_types = list()
- vol_name = data_utils.rand_name("volume")
+ vol_name = data_utils.rand_name(self.__class__.__name__ + '-volume')
self.name_field = self.special_fields['name_field']
proto = CONF.volume.storage_protocol
vendor = CONF.volume.vendor_name
@@ -43,7 +43,8 @@
"vendor_name": vendor}
# Create two volume_types
for i in range(2):
- vol_type_name = data_utils.rand_name("volume-type")
+ vol_type_name = data_utils.rand_name(
+ self.__class__.__name__ + '-volume-type')
vol_type = self.create_volume_type(
name=vol_type_name,
extra_specs=extra_specs)
@@ -87,7 +88,7 @@
def test_volume_type_create_get_delete(self):
# Create/get volume type.
body = {}
- name = data_utils.rand_name("volume-type")
+ name = data_utils.rand_name(self.__class__.__name__ + '-volume-type')
description = data_utils.rand_name("volume-type-description")
proto = CONF.volume.storage_protocol
vendor = CONF.volume.vendor_name
@@ -122,7 +123,7 @@
# Create/get/delete encryption type.
provider = "LuksEncryptor"
control_location = "front-end"
- name = data_utils.rand_name("volume-type")
+ name = data_utils.rand_name(self.__class__.__name__ + '-volume-type')
body = self.create_volume_type(name=name)
# Create encryption type
encryption_type = \
diff --git a/tempest/api/volume/admin/test_volume_types_extra_specs.py b/tempest/api/volume/admin/test_volume_types_extra_specs.py
old mode 100644
new mode 100755
index 9e49b94..d50ba27
--- a/tempest/api/volume/admin/test_volume_types_extra_specs.py
+++ b/tempest/api/volume/admin/test_volume_types_extra_specs.py
@@ -23,7 +23,7 @@
@classmethod
def resource_setup(cls):
super(VolumeTypesExtraSpecsV2Test, cls).resource_setup()
- vol_type_name = data_utils.rand_name('Volume-type')
+ vol_type_name = data_utils.rand_name(cls.__name__ + '-Volume-type')
cls.volume_type = cls.create_volume_type(name=vol_type_name)
@test.idempotent_id('b42923e9-0452-4945-be5b-d362ae533e60')
diff --git a/tempest/api/volume/admin/test_volume_types_extra_specs_negative.py b/tempest/api/volume/admin/test_volume_types_extra_specs_negative.py
old mode 100644
new mode 100755
index 2193aa6..2e07457
--- a/tempest/api/volume/admin/test_volume_types_extra_specs_negative.py
+++ b/tempest/api/volume/admin/test_volume_types_extra_specs_negative.py
@@ -24,7 +24,7 @@
@classmethod
def resource_setup(cls):
super(ExtraSpecsNegativeV2Test, cls).resource_setup()
- vol_type_name = data_utils.rand_name('Volume-type')
+ vol_type_name = data_utils.rand_name(cls.__name__ + '-Volume-type')
cls.extra_specs = {"spec1": "val1"}
cls.volume_type = cls.create_volume_type(name=vol_type_name,
extra_specs=cls.extra_specs)
diff --git a/tempest/api/volume/admin/test_volumes_actions.py b/tempest/api/volume/admin/test_volumes_actions.py
old mode 100644
new mode 100755
index 5388f7f..03927e6
--- a/tempest/api/volume/admin/test_volumes_actions.py
+++ b/tempest/api/volume/admin/test_volumes_actions.py
@@ -59,7 +59,7 @@
def _create_temp_volume(self):
# Create a temp volume for force delete tests
- vol_name = utils.rand_name('Volume')
+ vol_name = utils.rand_name(self.__class__.__name__ + '-Volume')
params = {self.name_field: vol_name}
temp_volume = self.client.create_volume(**params)['volume']
waiters.wait_for_volume_status(self.client,
diff --git a/tempest/api/volume/admin/test_volumes_backup.py b/tempest/api/volume/admin/test_volumes_backup.py
old mode 100644
new mode 100755
index ff28b50..f7013d8
--- a/tempest/api/volume/admin/test_volumes_backup.py
+++ b/tempest/api/volume/admin/test_volumes_backup.py
@@ -67,7 +67,7 @@
be imported back in case of a DB loss.
"""
# Create backup
- backup_name = data_utils.rand_name('Backup')
+ backup_name = data_utils.rand_name(self.__class__.__name__ + '-Backup')
backup = (self.admin_backups_client.create_backup(
volume_id=self.volume['id'], name=backup_name)['backup'])
self.addCleanup(self._delete_backup, backup['id'])
@@ -131,7 +131,8 @@
@test.idempotent_id('47a35425-a891-4e13-961c-c45deea21e94')
def test_volume_backup_reset_status(self):
# Create a backup
- backup_name = data_utils.rand_name('Backup')
+ backup_name = data_utils.rand_name(
+ self.__class__.__name__ + '-Backup')
backup = self.admin_backups_client.create_backup(
volume_id=self.volume['id'], name=backup_name)['backup']
self.addCleanup(self.admin_backups_client.delete_backup,
diff --git a/tempest/api/volume/base.py b/tempest/api/volume/base.py
index 087b9a8..ef28add 100644
--- a/tempest/api/volume/base.py
+++ b/tempest/api/volume/base.py
@@ -110,7 +110,7 @@
@classmethod
def create_volume(cls, **kwargs):
"""Wrapper utility that returns a test volume."""
- name = data_utils.rand_name('Volume')
+ name = data_utils.rand_name(cls.__name__ + '-Volume')
name_field = cls.special_fields['name_field']
@@ -236,7 +236,7 @@
@classmethod
def create_volume_type(cls, name=None, **kwargs):
"""Create a test volume-type"""
- name = name or data_utils.rand_name('volume-type')
+ name = name or data_utils.rand_name(cls.__name__ + '-volume-type')
volume_type = cls.admin_volume_types_client.create_volume_type(
name=name, **kwargs)['volume_type']
cls.volume_types.append(volume_type['id'])
diff --git a/tempest/api/volume/test_volumes_actions.py b/tempest/api/volume/test_volumes_actions.py
old mode 100644
new mode 100755
index 76cd36c..d5e1e6b
--- a/tempest/api/volume/test_volumes_actions.py
+++ b/tempest/api/volume/test_volumes_actions.py
@@ -129,7 +129,7 @@
# it is shared with the other tests. After it is uploaded in Glance,
# there is no way to delete it from Cinder, so we delete it from Glance
# using the Glance image_client and from Cinder via tearDownClass.
- image_name = data_utils.rand_name('Image')
+ image_name = data_utils.rand_name(self.__class__.__name__ + '-Image')
body = self.client.upload_volume(
self.volume['id'], image_name=image_name,
disk_format=CONF.volume.disk_format)['os-volume_upload_image']
diff --git a/tempest/api/volume/test_volumes_backup.py b/tempest/api/volume/test_volumes_backup.py
old mode 100644
new mode 100755
index d83c308..8e78a89
--- a/tempest/api/volume/test_volumes_backup.py
+++ b/tempest/api/volume/test_volumes_backup.py
@@ -39,7 +39,8 @@
@test.idempotent_id('a66eb488-8ee1-47d4-8e9f-575a095728c6')
def test_volume_backup_create_get_detailed_list_restore_delete(self):
# Create backup
- backup_name = data_utils.rand_name('Backup')
+ backup_name = data_utils.rand_name(
+ self.__class__.__name__ + '-Backup')
create_backup = self.backups_client.create_backup
backup = create_backup(volume_id=self.volume['id'],
name=backup_name)['backup']
@@ -83,7 +84,8 @@
is "available" or "in-use".
"""
# Create a server
- server_name = data_utils.rand_name('instance')
+ server_name = data_utils.rand_name(
+ self.__class__.__name__ + '-instance')
server = self.create_server(name=server_name, wait_until='ACTIVE')
self.addCleanup(self.servers_client.delete_server, server['id'])
# Attach volume to instance
@@ -96,7 +98,8 @@
self.addCleanup(self.servers_client.detach_volume, server['id'],
self.volume['id'])
# Create backup using force flag
- backup_name = data_utils.rand_name('Backup')
+ backup_name = data_utils.rand_name(
+ self.__class__.__name__ + '-Backup')
backup = self.backups_client.create_backup(
volume_id=self.volume['id'],
name=backup_name, force=True)['backup']
diff --git a/tempest/api/volume/test_volumes_get.py b/tempest/api/volume/test_volumes_get.py
old mode 100644
new mode 100755
index 4c6aeb7..7a1c0a1
--- a/tempest/api/volume/test_volumes_get.py
+++ b/tempest/api/volume/test_volumes_get.py
@@ -41,7 +41,7 @@
def _volume_create_get_update_delete(self, **kwargs):
# Create a volume, Get it's details and Delete the volume
- v_name = data_utils.rand_name('Volume')
+ v_name = data_utils.rand_name(self.__class__.__name__ + '-Volume')
metadata = {'Type': 'Test'}
# Create a volume
kwargs[self.name_field] = v_name
@@ -81,7 +81,8 @@
params = {self.name_field: v_name}
self.client.update_volume(volume['id'], **params)
# Test volume update when display_name is new
- new_v_name = data_utils.rand_name('new-Volume')
+ new_v_name = data_utils.rand_name(
+ self.__class__.__name__ + '-new-Volume')
new_desc = 'This is the new description of volume'
params = {self.name_field: new_v_name,
self.descrip_field: new_desc}
diff --git a/tempest/api/volume/test_volumes_negative.py b/tempest/api/volume/test_volumes_negative.py
old mode 100644
new mode 100755
index 77bfaf1..d2c05ae
--- a/tempest/api/volume/test_volumes_negative.py
+++ b/tempest/api/volume/test_volumes_negative.py
@@ -56,7 +56,7 @@
def test_create_volume_with_invalid_size(self):
# Should not be able to create volume with invalid size
# in request
- v_name = data_utils.rand_name('Volume')
+ v_name = data_utils.rand_name(self.__class__.__name__ + '-Volume')
metadata = {'Type': 'work'}
self.assertRaises(lib_exc.BadRequest, self.client.create_volume,
size='#$%', display_name=v_name, metadata=metadata)
@@ -66,7 +66,7 @@
def test_create_volume_with_out_passing_size(self):
# Should not be able to create volume without passing size
# in request
- v_name = data_utils.rand_name('Volume')
+ v_name = data_utils.rand_name(self.__class__.__name__ + '-Volume')
metadata = {'Type': 'work'}
self.assertRaises(lib_exc.BadRequest, self.client.create_volume,
size='', display_name=v_name, metadata=metadata)
@@ -75,7 +75,7 @@
@test.idempotent_id('41331caa-eaf4-4001-869d-bc18c1869360')
def test_create_volume_with_size_zero(self):
# Should not be able to create volume with size zero
- v_name = data_utils.rand_name('Volume')
+ v_name = data_utils.rand_name(self.__class__.__name__ + '-Volume')
metadata = {'Type': 'work'}
self.assertRaises(lib_exc.BadRequest, self.client.create_volume,
size='0', display_name=v_name, metadata=metadata)
@@ -84,7 +84,7 @@
@test.idempotent_id('8b472729-9eba-446e-a83b-916bdb34bef7')
def test_create_volume_with_size_negative(self):
# Should not be able to create volume with size negative
- v_name = data_utils.rand_name('Volume')
+ v_name = data_utils.rand_name(self.__class__.__name__ + '-Volume')
metadata = {'Type': 'work'}
self.assertRaises(lib_exc.BadRequest, self.client.create_volume,
size='-1', display_name=v_name, metadata=metadata)
@@ -93,7 +93,7 @@
@test.idempotent_id('10254ed8-3849-454e-862e-3ab8e6aa01d2')
def test_create_volume_with_nonexistent_volume_type(self):
# Should not be able to create volume with non-existent volume type
- v_name = data_utils.rand_name('Volume')
+ v_name = data_utils.rand_name(self.__class__.__name__ + '-Volume')
metadata = {'Type': 'work'}
self.assertRaises(lib_exc.NotFound, self.client.create_volume,
size='1', volume_type=data_utils.rand_uuid(),
@@ -103,7 +103,7 @@
@test.idempotent_id('0c36f6ae-4604-4017-b0a9-34fdc63096f9')
def test_create_volume_with_nonexistent_snapshot_id(self):
# Should not be able to create volume with non-existent snapshot
- v_name = data_utils.rand_name('Volume')
+ v_name = data_utils.rand_name(self.__class__.__name__ + '-Volume')
metadata = {'Type': 'work'}
self.assertRaises(lib_exc.NotFound, self.client.create_volume,
size='1', snapshot_id=data_utils.rand_uuid(),
@@ -113,7 +113,7 @@
@test.idempotent_id('47c73e08-4be8-45bb-bfdf-0c4e79b88344')
def test_create_volume_with_nonexistent_source_volid(self):
# Should not be able to create volume with non-existent source volume
- v_name = data_utils.rand_name('Volume')
+ v_name = data_utils.rand_name(self.__class__.__name__ + '-Volume')
metadata = {'Type': 'work'}
self.assertRaises(lib_exc.NotFound, self.client.create_volume,
size='1', source_volid=data_utils.rand_uuid(),
@@ -122,7 +122,7 @@
@test.attr(type=['negative'])
@test.idempotent_id('0186422c-999a-480e-a026-6a665744c30c')
def test_update_volume_with_nonexistent_volume_id(self):
- v_name = data_utils.rand_name('Volume')
+ v_name = data_utils.rand_name(self.__class__.__name__ + '-Volume')
metadata = {'Type': 'work'}
self.assertRaises(lib_exc.NotFound, self.client.update_volume,
volume_id=data_utils.rand_uuid(),
@@ -132,7 +132,7 @@
@test.attr(type=['negative'])
@test.idempotent_id('e66e40d6-65e6-4e75-bdc7-636792fa152d')
def test_update_volume_with_invalid_volume_id(self):
- v_name = data_utils.rand_name('Volume')
+ v_name = data_utils.rand_name(self.__class__.__name__ + '-Volume')
metadata = {'Type': 'work'}
self.assertRaises(lib_exc.NotFound, self.client.update_volume,
volume_id='#$%%&^&^', display_name=v_name,
@@ -141,7 +141,7 @@
@test.attr(type=['negative'])
@test.idempotent_id('72aeca85-57a5-4c1f-9057-f320f9ea575b')
def test_update_volume_with_empty_volume_id(self):
- v_name = data_utils.rand_name('Volume')
+ v_name = data_utils.rand_name(self.__class__.__name__ + '-Volume')
metadata = {'Type': 'work'}
self.assertRaises(lib_exc.NotFound, self.client.update_volume,
volume_id='', display_name=v_name,
@@ -177,7 +177,7 @@
@test.idempotent_id('f5e56b0a-5d02-43c1-a2a7-c9b792c2e3f6')
@test.services('compute')
def test_attach_volumes_with_nonexistent_volume_id(self):
- srv_name = data_utils.rand_name('Instance')
+ srv_name = data_utils.rand_name(self.__class__.__name__ + '-Instance')
server = self.create_server(
name=srv_name,
wait_until='ACTIVE')
@@ -267,7 +267,7 @@
@test.attr(type=['negative'])
@test.idempotent_id('0f4aa809-8c7b-418f-8fb3-84c7a5dfc52f')
def test_list_volumes_with_nonexistent_name(self):
- v_name = data_utils.rand_name('Volume')
+ v_name = data_utils.rand_name(self.__class__.__name__ + '-Volume')
params = {self.name_field: v_name}
fetched_volume = self.client.list_volumes(params=params)['volumes']
self.assertEqual(0, len(fetched_volume))
@@ -275,7 +275,7 @@
@test.attr(type=['negative'])
@test.idempotent_id('9ca17820-a0e7-4cbd-a7fa-f4468735e359')
def test_list_volumes_detail_with_nonexistent_name(self):
- v_name = data_utils.rand_name('Volume')
+ v_name = data_utils.rand_name(self.__class__.__name__ + '-Volume')
params = {self.name_field: v_name}
fetched_volume = \
self.client.list_volumes(detail=True, params=params)['volumes']
diff --git a/tempest/api/volume/test_volumes_snapshots.py b/tempest/api/volume/test_volumes_snapshots.py
old mode 100644
new mode 100755
index c7f1e6e..20c647a
--- a/tempest/api/volume/test_volumes_snapshots.py
+++ b/tempest/api/volume/test_volumes_snapshots.py
@@ -75,7 +75,8 @@
def test_snapshot_create_with_volume_in_use(self):
# Create a snapshot when volume status is in-use
# Create a test instance
- server_name = data_utils.rand_name('instance')
+ server_name = data_utils.rand_name(
+ self.__class__.__name__ + '-instance')
server = self.create_server(
name=server_name,
wait_until='ACTIVE')
@@ -98,7 +99,7 @@
@test.idempotent_id('2a8abbe4-d871-46db-b049-c41f5af8216e')
def test_snapshot_create_get_list_update_delete(self):
# Create a snapshot
- s_name = data_utils.rand_name('snap')
+ s_name = data_utils.rand_name(self.__class__.__name__ + '-snap')
params = {self.name_field: s_name}
snapshot = self.create_snapshot(self.volume_origin['id'], **params)
@@ -116,7 +117,8 @@
self.assertIn(tracking_data, snaps_data)
# Updates snapshot with new values
- new_s_name = data_utils.rand_name('new-snap')
+ new_s_name = data_utils.rand_name(
+ self.__class__.__name__ + '-new-snap')
new_desc = 'This is the new description of snapshot.'
params = {self.name_field: new_s_name,
self.descrip_field: new_desc}
@@ -138,7 +140,7 @@
def test_snapshots_list_with_params(self):
"""list snapshots with params."""
# Create a snapshot
- display_name = data_utils.rand_name('snap')
+ display_name = data_utils.rand_name(self.__class__.__name__ + '-snap')
params = {self.name_field: display_name}
snapshot = self.create_snapshot(self.volume_origin['id'], **params)
self.addCleanup(self.cleanup_snapshot, snapshot)
@@ -160,7 +162,7 @@
def test_snapshots_list_details_with_params(self):
"""list snapshot details with params."""
# Create a snapshot
- display_name = data_utils.rand_name('snap')
+ display_name = data_utils.rand_name(self.__class__.__name__ + '-snap')
params = {self.name_field: display_name}
snapshot = self.create_snapshot(self.volume_origin['id'], **params)
self.addCleanup(self.cleanup_snapshot, snapshot)
diff --git a/tempest/api/volume/test_volumes_snapshots_negative.py b/tempest/api/volume/test_volumes_snapshots_negative.py
old mode 100644
new mode 100755
index 2df9523..1f5bb0d
--- a/tempest/api/volume/test_volumes_snapshots_negative.py
+++ b/tempest/api/volume/test_volumes_snapshots_negative.py
@@ -31,7 +31,7 @@
@test.idempotent_id('e3e466af-70ab-4f4b-a967-ab04e3532ea7')
def test_create_snapshot_with_nonexistent_volume_id(self):
# Create a snapshot with nonexistent volume id
- s_name = data_utils.rand_name('snap')
+ s_name = data_utils.rand_name(self.__class__.__name__ + '-snap')
self.assertRaises(lib_exc.NotFound,
self.snapshots_client.create_snapshot,
volume_id=data_utils.rand_uuid(),
@@ -41,7 +41,7 @@
@test.idempotent_id('bb9da53e-d335-4309-9c15-7e76fd5e4d6d')
def test_create_snapshot_without_passing_volume_id(self):
# Create a snapshot without passing volume id
- s_name = data_utils.rand_name('snap')
+ s_name = data_utils.rand_name(self.__class__.__name__ + '-snap')
self.assertRaises(lib_exc.NotFound,
self.snapshots_client.create_snapshot,
volume_id=None, display_name=s_name)
diff --git a/tempest/api/volume/v3/admin/test_user_messages.py b/tempest/api/volume/v3/admin/test_user_messages.py
old mode 100644
new mode 100755
index 9d59d1b..517c8d7
--- a/tempest/api/volume/v3/admin/test_user_messages.py
+++ b/tempest/api/volume/v3/admin/test_user_messages.py
@@ -42,7 +42,8 @@
bad_vendor = data_utils.rand_name('vendor_name')
extra_specs = {'storage_protocol': bad_protocol,
'vendor_name': bad_vendor}
- vol_type_name = data_utils.rand_name('volume-type')
+ vol_type_name = data_utils.rand_name(
+ self.__class__.__name__ + '-volume-type')
bogus_type = self.admin_volume_types_client.create_volume_type(
name=vol_type_name,
extra_specs=extra_specs)['volume_type']
diff --git a/tempest/common/compute.py b/tempest/common/compute.py
index a2edcdc..194b9e9 100644
--- a/tempest/common/compute.py
+++ b/tempest/common/compute.py
@@ -101,7 +101,7 @@
wait_until = 'ACTIVE'
if volume_backed:
- volume_name = data_utils.rand_name('volume')
+ volume_name = data_utils.rand_name(__name__ + '-volume')
volumes_client = clients.volumes_v2_client
if CONF.volume_feature_enabled.api_v1:
volumes_client = clients.volumes_client
diff --git a/tempest/scenario/test_volume_boot_pattern.py b/tempest/scenario/test_volume_boot_pattern.py
old mode 100644
new mode 100755
index 25d825a..3f6d9c4
--- a/tempest/scenario/test_volume_boot_pattern.py
+++ b/tempest/scenario/test_volume_boot_pattern.py
@@ -48,7 +48,8 @@
def _create_volume_from_image(self):
img_uuid = CONF.compute.image_ref
- vol_name = data_utils.rand_name('volume-origin')
+ vol_name = data_utils.rand_name(
+ self.__class__.__name__ + '-volume-origin')
return self.create_volume(name=vol_name, imageRef=img_uuid)
def _get_bdm(self, vol_id, delete_on_termination=False):
@@ -79,7 +80,8 @@
**create_kwargs)
def _create_snapshot_from_volume(self, vol_id):
- snap_name = data_utils.rand_name('snapshot')
+ snap_name = data_utils.rand_name(
+ self.__class__.__name__ + '-snapshot')
snap = self.snapshots_client.create_snapshot(
volume_id=vol_id,
force=True,
@@ -99,7 +101,8 @@
return snap
def _create_volume_from_snapshot(self, snap_id):
- vol_name = data_utils.rand_name('volume')
+ vol_name = data_utils.rand_name(
+ self.__class__.__name__ + '-volume')
return self.create_volume(name=vol_name, snapshot_id=snap_id)
def _delete_server(self, server):
@@ -170,7 +173,7 @@
instance = self._boot_instance_from_volume(volume_origin['id'],
delete_on_termination=True)
# create EBS image
- name = data_utils.rand_name('image')
+ name = data_utils.rand_name(self.__class__.__name__ + '-image')
image = self.create_server_snapshot(instance, name=name)
# delete instance