Merge "Whether to delete snapshot explicitly" into mcp/caracal
diff --git a/tempest/api/volume/admin/test_volume_retype.py b/tempest/api/volume/admin/test_volume_retype.py
index 4cb2262..586111c 100644
--- a/tempest/api/volume/admin/test_volume_retype.py
+++ b/tempest/api/volume/admin/test_volume_retype.py
@@ -63,9 +63,10 @@
         src_vol = self.create_volume(volume_type=self.src_vol_type['name'],
                                      snapshot_id=snapshot['id'])
 
-        # Delete the snapshot
-        self.snapshots_client.delete_snapshot(snapshot['id'])
-        self.snapshots_client.wait_for_resource_deletion(snapshot['id'])
+        if not CONF.volume_feature_enabled.snapshot_locked_by_volume:
+            # Delete the snapshot
+            self.snapshots_client.delete_snapshot(snapshot['id'])
+            self.snapshots_client.wait_for_resource_deletion(snapshot['id'])
 
         return src_vol
 
diff --git a/tempest/config.py b/tempest/config.py
index ff7e977..b41ec84 100644
--- a/tempest/config.py
+++ b/tempest/config.py
@@ -1133,6 +1133,10 @@
     cfg.ListOpt('supported_crypto_providers',
                 default=['luks'],
                 help='A list of enabled cryptoproviders for volumes'),
+    cfg.BoolOpt('snapshot_locked_by_volume',
+                default=False,
+                help='Whether snapshot can be deleted, i.e. there is no '
+                     'volume dependent on (created from) it'),
 ]