Add possibility to skip quota tests in Tempest
We have possibility to disable some sets of Manila functional tests
using config options and cannot do it for quota tests.
So, add new 'run_quota_tests' option to be able to do so.
Change-Id: I0ce3170a2568f24a86573e4f45661a4e862af6ac
diff --git a/manila_tempest_tests/config.py b/manila_tempest_tests/config.py
index e52ca42..8183d1c 100644
--- a/manila_tempest_tests/config.py
+++ b/manila_tempest_tests/config.py
@@ -135,6 +135,9 @@
"enabling this opt."),
# Switching ON/OFF test suites filtered by features
+ cfg.BoolOpt("run_quota_tests",
+ default=True,
+ help="Defines whether to run quota tests or not."),
cfg.BoolOpt("run_extend_tests",
default=True,
help="Defines whether to run share extend tests or not. "
diff --git a/manila_tempest_tests/tests/api/admin/test_quotas.py b/manila_tempest_tests/tests/api/admin/test_quotas.py
index badedc2..3c99083 100644
--- a/manila_tempest_tests/tests/api/admin/test_quotas.py
+++ b/manila_tempest_tests/tests/api/admin/test_quotas.py
@@ -26,6 +26,9 @@
@classmethod
def resource_setup(cls):
+ if not CONF.share.run_quota_tests:
+ msg = "Quota tests are disabled."
+ raise cls.skipException(msg)
cls.os = clients.AdminManager()
super(SharesAdminQuotasTest, cls).resource_setup()
cls.user_id = cls.shares_v2_client.user_id
@@ -65,6 +68,14 @@
force_tenant_isolation = True
client_version = '2'
+ @classmethod
+ def resource_setup(cls):
+ if not CONF.share.run_quota_tests:
+ msg = "Quota tests are disabled."
+ raise cls.skipException(msg)
+ cls.os = clients.AdminManager()
+ super(SharesAdminQuotasUpdateTest, cls).resource_setup()
+
def setUp(self):
super(self.__class__, self).setUp()
self.client = self.get_client_with_isolated_creds(
diff --git a/manila_tempest_tests/tests/api/admin/test_quotas_negative.py b/manila_tempest_tests/tests/api/admin/test_quotas_negative.py
index 7850a2d..1cd0ac0 100644
--- a/manila_tempest_tests/tests/api/admin/test_quotas_negative.py
+++ b/manila_tempest_tests/tests/api/admin/test_quotas_negative.py
@@ -30,6 +30,9 @@
@classmethod
def resource_setup(cls):
+ if not CONF.share.run_quota_tests:
+ msg = "Quota tests are disabled."
+ raise cls.skipException(msg)
cls.os = clients.AdminManager()
super(SharesAdminQuotasNegativeTest, cls).resource_setup()
cls.user_id = cls.shares_client.user_id
diff --git a/manila_tempest_tests/tests/api/test_quotas.py b/manila_tempest_tests/tests/api/test_quotas.py
index da6dcce..77eae42 100644
--- a/manila_tempest_tests/tests/api/test_quotas.py
+++ b/manila_tempest_tests/tests/api/test_quotas.py
@@ -14,16 +14,22 @@
# under the License.
import ddt
-from tempest import test # noqa
+from tempest import config
+from tempest import test
from manila_tempest_tests.tests.api import base
+CONF = config.CONF
+
@ddt.data
class SharesQuotasTest(base.BaseSharesTest):
@classmethod
def resource_setup(cls):
+ if not CONF.share.run_quota_tests:
+ msg = "Quota tests are disabled."
+ raise cls.skipException(msg)
super(SharesQuotasTest, cls).resource_setup()
cls.user_id = cls.shares_v2_client.user_id
cls.tenant_id = cls.shares_v2_client.tenant_id
diff --git a/manila_tempest_tests/tests/api/test_quotas_negative.py b/manila_tempest_tests/tests/api/test_quotas_negative.py
index e2d2c37..94dec59 100644
--- a/manila_tempest_tests/tests/api/test_quotas_negative.py
+++ b/manila_tempest_tests/tests/api/test_quotas_negative.py
@@ -14,15 +14,25 @@
# under the License.
import ddt
+from tempest import config
from tempest import test
from tempest_lib import exceptions as lib_exc
from manila_tempest_tests.tests.api import base
+CONF = config.CONF
+
@ddt.ddt
class SharesQuotasNegativeTest(base.BaseSharesTest):
+ @classmethod
+ def resource_setup(cls):
+ if not CONF.share.run_quota_tests:
+ msg = "Quota tests are disabled."
+ raise cls.skipException(msg)
+ super(SharesQuotasNegativeTest, cls).resource_setup()
+
@test.attr(type=["gate", "smoke", "negative"])
def test_get_quotas_with_empty_tenant_id(self):
self.assertRaises(lib_exc.NotFound,