Add skip checks for snapshot manage and group snapshots tests
Tempest tests for snapshot manage and group snapshots involves creating
snapshots, and it is necessary to add skip checks to verify the storage
backend drivers whether support snapshot feature firstly.
Change-Id: I5759918f7262def1f29d2d7345b4e0738e5d0e60
diff --git a/tempest/api/volume/admin/test_group_snapshots.py b/tempest/api/volume/admin/test_group_snapshots.py
index 36e0035..45f4caa 100644
--- a/tempest/api/volume/admin/test_group_snapshots.py
+++ b/tempest/api/volume/admin/test_group_snapshots.py
@@ -16,13 +16,22 @@
from tempest.api.volume import base
from tempest.common import waiters
+from tempest import config
from tempest.lib.common.utils import data_utils
from tempest.lib.common.utils import test_utils
from tempest.lib import decorators
+CONF = config.CONF
+
class BaseGroupSnapshotsTest(base.BaseVolumeAdminTest):
+ @classmethod
+ def skip_checks(cls):
+ super(BaseGroupSnapshotsTest, cls).skip_checks()
+ if not CONF.volume_feature_enabled.snapshot:
+ raise cls.skipException("Cinder volume snapshots are disabled")
+
def _create_group_snapshot(self, **kwargs):
if 'name' not in kwargs:
kwargs['name'] = data_utils.rand_name(
diff --git a/tempest/api/volume/admin/test_snapshot_manage.py b/tempest/api/volume/admin/test_snapshot_manage.py
index 9ff7160..3b21b28 100644
--- a/tempest/api/volume/admin/test_snapshot_manage.py
+++ b/tempest/api/volume/admin/test_snapshot_manage.py
@@ -35,6 +35,9 @@
def skip_checks(cls):
super(SnapshotManageAdminTest, cls).skip_checks()
+ if not CONF.volume_feature_enabled.snapshot:
+ raise cls.skipException("Cinder volume snapshots are disabled")
+
if not CONF.volume_feature_enabled.manage_snapshot:
raise cls.skipException("Manage snapshot tests are disabled")