Add snapshot deletion test
This adds a new test to ensure that snapshots can be deleted when a volume is cloned from them. Depends-On: I8ffb0c1130b30a19f336a98a9efef05905786af2 Change-Id: I18827bba3bc2730cde37696292b00a286bc53ef3
This commit is contained in:
parent
a259e8d43e
commit
95e64bd9e8
|
@ -14,6 +14,7 @@
|
|||
# under the License.
|
||||
|
||||
from tempest.common import utils
|
||||
from tempest.common import waiters
|
||||
from tempest.lib import decorators
|
||||
|
||||
from cinder_tempest_plugin.scenario import manager
|
||||
|
@ -121,3 +122,31 @@ class SnapshotDataIntegrityTests(manager.ScenarioTest):
|
|||
|
||||
self.assertEqual(count_snap, i)
|
||||
self.assertEqual(file_map[i], md5_file)
|
||||
|
||||
|
||||
class SnapshotDependencyTests(manager.ScenarioTest):
|
||||
@decorators.idempotent_id('e7028f52-f6d4-479c-8809-6f6cf96cfe0f')
|
||||
@utils.services('image', 'volume')
|
||||
def test_snapshot_removal(self):
|
||||
volume_1 = self.create_volume_from_image()
|
||||
|
||||
snapshot_1 = self.create_volume_snapshot(volume_1['id'], force=True)
|
||||
waiters.wait_for_volume_resource_status(
|
||||
self.snapshots_client, snapshot_1['id'], 'available')
|
||||
|
||||
clone_kwargs = {'snapshot_id': snapshot_1['id'],
|
||||
'size': volume_1['size']}
|
||||
volume_2 = self.volumes_client.create_volume(**clone_kwargs)['volume']
|
||||
|
||||
waiters.wait_for_volume_resource_status(
|
||||
self.volumes_client, volume_2['id'], 'available')
|
||||
volume_2 = self.volumes_client.show_volume(volume_2['id'])['volume']
|
||||
|
||||
self.snapshots_client.delete_snapshot(snapshot_1['id'])
|
||||
self.snapshots_client.wait_for_resource_deletion(snapshot_1['id'])
|
||||
|
||||
self.volumes_client.delete_volume(volume_1['id'])
|
||||
self.volumes_client.wait_for_resource_deletion(volume_1['id'])
|
||||
|
||||
self.volumes_client.delete_volume(volume_2['id'])
|
||||
self.volumes_client.wait_for_resource_deletion(volume_2['id'])
|
||||
|
|
Loading…
Reference in New Issue