From b0d15bfefb0035ecbf732dfcd75fe4bcbde64808 Mon Sep 17 00:00:00 2001 From: Ghanshyam Mann Date: Tue, 2 May 2017 04:55:47 +0000 Subject: [PATCH] Revert "cinder backup force-delete when backup is error" force-delete feature is backend specific and not implemented by ceph. It return 405 in case of ceph. http://logs.openstack.org/01/458201/2/check/gate-tempest-dsvm-full-ceph-plugin-src-glance_store-ubuntu-xenial/d058f29/logs/testr_results.html.gz Currently it block the glance_store gate where ceph job is voting. Let's revert this for now and discuss such backend specific feature should be tested on Tempest side or not. This reverts commit 31169e21d6f00fb65b8e7bd104860a82a631b69d. Related-Bug: #1687538 Change-Id: I81c0911812945f8ada7c09fe98690aabacb0eda1 --- ...-volume-backup-force-delete-af0156651a0cbf7f.yaml | 9 --------- tempest/api/volume/admin/test_volumes_backup.py | 5 +---- tempest/api/volume/base.py | 12 ++++-------- tempest/lib/services/volume/v2/backups_client.py | 8 -------- 4 files changed, 5 insertions(+), 29 deletions(-) delete mode 100644 releasenotes/notes/add-volume-backup-force-delete-af0156651a0cbf7f.yaml diff --git a/releasenotes/notes/add-volume-backup-force-delete-af0156651a0cbf7f.yaml b/releasenotes/notes/add-volume-backup-force-delete-af0156651a0cbf7f.yaml deleted file mode 100644 index 71bbfcb4ef..0000000000 --- a/releasenotes/notes/add-volume-backup-force-delete-af0156651a0cbf7f.yaml +++ /dev/null @@ -1,9 +0,0 @@ ---- -features: - - | - As in the [doc]: - https://developer.openstack.org/api-ref/block-storage/v3/ - #force-delete-a-backup. - - * Force-deletes a backup(v2) - diff --git a/tempest/api/volume/admin/test_volumes_backup.py b/tempest/api/volume/admin/test_volumes_backup.py index 7d2127f99b..29c79f9fe4 100644 --- a/tempest/api/volume/admin/test_volumes_backup.py +++ b/tempest/api/volume/admin/test_volumes_backup.py @@ -121,7 +121,7 @@ class VolumesBackupsAdminV2Test(base.BaseVolumeAdminTest): 'available') @decorators.idempotent_id('47a35425-a891-4e13-961c-c45deea21e94') - def test_volume_backup_reset_status_force_delete(self): + def test_volume_backup_reset_status(self): # Create a volume volume = self.create_volume() # Create a backup @@ -136,6 +136,3 @@ class VolumesBackupsAdminV2Test(base.BaseVolumeAdminTest): status="error") waiters.wait_for_volume_resource_status(self.admin_backups_client, backup['id'], 'error') - # Force delete a backup volume when backup is in error state. - self.admin_backups_client.force_delete_backup(backup['id']) - self.admin_backups_client.wait_for_resource_deletion(backup['id']) diff --git a/tempest/api/volume/base.py b/tempest/api/volume/base.py index 2362d30258..5e4fada0ef 100644 --- a/tempest/api/volume/base.py +++ b/tempest/api/volume/base.py @@ -125,20 +125,16 @@ class BaseVolumeTest(tempest.test.BaseTestCase): snapshot['id'], 'available') return snapshot - def create_backup(self, volume_id, backup_client=None, - wait_until="available", **kwargs): + def create_backup(self, volume_id, backup_client=None, **kwargs): """Wrapper utility that returns a test backup.""" if backup_client is None: backup_client = self.backups_client backup = backup_client.create_backup( volume_id=volume_id, **kwargs)['backup'] - - 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'], - wait_until) + self.addCleanup(backup_client.delete_backup, backup['id']) + waiters.wait_for_volume_resource_status(backup_client, backup['id'], + 'available') return backup # NOTE(afazekas): these create_* and clean_* could be defined diff --git a/tempest/lib/services/volume/v2/backups_client.py b/tempest/lib/services/volume/v2/backups_client.py index 197d57ea7e..2b5e82d9b2 100644 --- a/tempest/lib/services/volume/v2/backups_client.py +++ b/tempest/lib/services/volume/v2/backups_client.py @@ -55,14 +55,6 @@ class BackupsClient(rest_client.RestClient): self.expected_success(202, resp.status) return rest_client.ResponseBody(resp, body) - def force_delete_backup(self, backup_id): - """Force delete a backup volume.""" - post_body = json.dumps({'os-force_delete': {}}) - url = 'backups/%s/action' % backup_id - resp, body = self.post(url, post_body) - self.expected_success(202, resp.status) - return rest_client.ResponseBody(resp) - def show_backup(self, backup_id): """Returns the details of a single backup.""" url = "backups/%s" % backup_id