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
This commit is contained in:
parent
29cbef0532
commit
45f741a3b1
@ -135,6 +135,9 @@ ShareGroup = [
|
||||
"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. "
|
||||
|
@ -26,6 +26,9 @@ class SharesAdminQuotasTest(base.BaseSharesAdminTest):
|
||||
|
||||
@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 @@ class SharesAdminQuotasUpdateTest(base.BaseSharesAdminTest):
|
||||
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(
|
||||
|
@ -30,6 +30,9 @@ class SharesAdminQuotasNegativeTest(base.BaseSharesAdminTest):
|
||||
|
||||
@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
|
||||
|
@ -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
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user