summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2018-10-04 03:11:36 +0000
committerGerrit Code Review <review@openstack.org>2018-10-04 03:11:36 +0000
commit9540ed07abc346e1174e40a9e1ad12cf274c04db (patch)
treedf2c2561c5cdd772aa30d3c2499e080415d39da3
parentc51402f1a58e4e2add2349593c4d0ac5df69e607 (diff)
parentc96757b275a77a745c6c80947bdd0bcb2de7eefd (diff)
downloadcinder-tempest-plugin-9540ed07abc346e1174e40a9e1ad12cf274c04db.zip
cinder-tempest-plugin-9540ed07abc346e1174e40a9e1ad12cf274c04db.tar.gz
cinder-tempest-plugin-9540ed07abc346e1174e40a9e1ad12cf274c04db.tar.bz2
Merge "Remove redundant cleanups in test_volume_backup"
-rw-r--r--cinder_tempest_plugin/api/volume/base.py4
-rw-r--r--cinder_tempest_plugin/api/volume/test_volume_backup.py41
2 files changed, 7 insertions, 38 deletions
diff --git a/cinder_tempest_plugin/api/volume/base.py b/cinder_tempest_plugin/api/volume/base.py
index d1e71ef..7d7bf43 100644
--- a/cinder_tempest_plugin/api/volume/base.py
+++ b/cinder_tempest_plugin/api/volume/base.py
@@ -143,7 +143,9 @@ class BaseVolumeTest(api_version_utils.BaseMicroversionTest,
backup = backup_client.create_backup(
volume_id=volume_id, **kwargs)['backup']
- self.addCleanup(backup_client.delete_backup, backup['id'])
+ self.addCleanup(backup_client.wait_for_resource_deletion, backup['id'])
+ self.addCleanup(test_utils.call_and_ignore_notfound_exc,
+ backup_client.delete_backup, backup['id'])
waiters.wait_for_volume_resource_status(backup_client, backup['id'],
'available')
return backup
diff --git a/cinder_tempest_plugin/api/volume/test_volume_backup.py b/cinder_tempest_plugin/api/volume/test_volume_backup.py
index 4eb7703..8c81543 100644
--- a/cinder_tempest_plugin/api/volume/test_volume_backup.py
+++ b/cinder_tempest_plugin/api/volume/test_volume_backup.py
@@ -41,35 +41,16 @@ class VolumesBackupsTest(base.BaseVolumeTest):
backup = self.create_backup(
volume_id=volume['id'],
snapshot_id=snapshot['id'])
- # Get a given backup
- backup = self.backups_client.show_backup(
- backup['id'])['backup']
- waiters.wait_for_volume_resource_status(
- self.backups_client,
- backup['id'], 'available')
self.assertEqual(volume['id'], backup['volume_id'])
self.assertEqual(snapshot['id'], backup['snapshot_id'])
- self.snapshots_client.delete_snapshot(snapshot['id'])
- self.snapshots_client.wait_for_resource_deletion(snapshot['id'])
-
- self.volumes_client.delete_volume(volume['id'])
- self.volumes_client.wait_for_resource_deletion(volume['id'])
-
@decorators.idempotent_id('b5d837b0-7066-455d-88fc-4a721a899306')
def test_backup_create_and_restore_to_an_existing_volume(self):
"""Test backup create and restore to an existing volume."""
# Create volume
src_vol = self.create_volume()
- self.addCleanup(self.volumes_client.delete_volume,
- src_vol['id'])
# Create backup
- backup = self.backups_client.create_backup(
- volume_id=src_vol['id'])['backup']
- self.addCleanup(self.backups_client.delete_backup, backup['id'])
- waiters.wait_for_volume_resource_status(
- self.backups_client,
- backup['id'], 'available')
+ backup = self.create_backup(volume_id=src_vol['id'])
# Restore to existing volume
restore = self.backups_client.restore_backup(
backup_id=backup['id'],
@@ -89,14 +70,9 @@ class VolumesBackupsTest(base.BaseVolumeTest):
# Create volume from image
volume = self.create_volume(size=CONF.volume.volume_size,
imageRef=CONF.compute.image_ref)
- self.addCleanup(self.volumes_client.delete_volume,
- volume['id'])
# Create backup
- backup = self.backups_client.create_backup(
- volume_id=volume['id'])['backup']
- waiters.wait_for_volume_resource_status(self.backups_client,
- backup['id'], 'available')
+ self.create_backup(volume_id=volume['id'])
# Create a server
bd_map = [{'volume_id': volume['id'],
'delete_on_termination': '0'}]
@@ -112,19 +88,10 @@ class VolumesBackupsTest(base.BaseVolumeTest):
# Create incremental backup
waiters.wait_for_volume_resource_status(self.volumes_client,
volume['id'], 'available')
- backup_incr = self.backups_client.create_backup(
+ backup_incr = self.create_backup(
volume_id=volume['id'],
- incremental=True)['backup']
-
- waiters.wait_for_volume_resource_status(self.backups_client,
- backup_incr['id'],
- 'available')
+ incremental=True)
is_incremental = self.backups_client.show_backup(
backup_incr['id'])['backup']['is_incremental']
self.assertTrue(is_incremental)
-
- self.backups_client.delete_backup(backup_incr['id'])
- self.backups_client.wait_for_resource_deletion(backup_incr['id'])
- self.backups_client.delete_backup(backup['id'])
- self.backups_client.wait_for_resource_deletion(backup['id'])

This mirror site include all the OpenStack related repositories under: openstack, openstack-dev and openstack-infra.

NOTE: All repositories are updated every one hour.

Usage

For Git Clone
 git clone http://git.trystack.cn/openstack/nova.git 
For DevStack

Add GIT_BASE, NOVNC_REPO and SPICE_REPO variables to local.conf file.

[[local|localrc]]

# use TryStack git mirror
GIT_BASE=http://git.trystack.cn
NOVNC_REPO=http://git.trystack.cn/kanaka/noVNC.git
SPICE_REPO=http://git.trystack.cn/git/spice/spice-html5.git