Add skip check for volume revert feature
Volume revert is a new feature added in microversion 3.40, and now not all
storage backend drivers have supported this feature. So it is necessary to
add a skip check for it in Tempest tests.
Change-Id: Icbd108f62f5b308e419843b03af20c8fe1278b24
diff --git a/cinder/tests/tempest/api/volume/test_volume_revert.py b/cinder/tests/tempest/api/volume/test_volume_revert.py
index 7314fdb..1f4bead 100644
--- a/cinder/tests/tempest/api/volume/test_volume_revert.py
+++ b/cinder/tests/tempest/api/volume/test_volume_revert.py
@@ -27,6 +27,12 @@
min_microversion = '3.40'
@classmethod
+ def skip_checks(cls):
+ super(VolumeRevertTests, cls).skip_checks()
+ if not CONF.volume_feature_enabled.volume_revert:
+ raise cls.skipException("Cinder volume revert feature disabled")
+
+ @classmethod
def setup_clients(cls):
cls._api_version = 3
super(VolumeRevertTests, cls).setup_clients()
diff --git a/cinder/tests/tempest/config.py b/cinder/tests/tempest/config.py
index f4eb098..e15a399 100644
--- a/cinder/tests/tempest/config.py
+++ b/cinder/tests/tempest/config.py
@@ -19,4 +19,7 @@
cfg.BoolOpt('consistency_group',
default=False,
help='Enable to run Cinder volume consistency group tests'),
+ cfg.BoolOpt('volume_revert',
+ default=False,
+ help='Enable to run Cinder volume revert tests'),
]