Merge "Add T115 for admin test path"
This commit is contained in:
commit
345dc6cda4
@ -22,6 +22,7 @@ Tempest Specific Commandments
|
||||
- [T112] Check that tempest.lib should not import local tempest code
|
||||
- [T113] Check that tests use data_utils.rand_uuid() instead of uuid.uuid4()
|
||||
- [T114] Check that tempest.lib does not use tempest config
|
||||
- [T115] Check that admin tests should exist under admin path
|
||||
- [N322] Method's default argument shouldn't be mutable
|
||||
|
||||
Test Data/Configuration
|
||||
|
@ -24,7 +24,7 @@ CONF = config.CONF
|
||||
# NOTE(zhufl): This inherits from BaseVolumeAdminTest because
|
||||
# it requires force_tenant_isolation=True, which need admin
|
||||
# credentials to create non-admin users for the tests.
|
||||
class AbsoluteLimitsTests(base.BaseVolumeAdminTest):
|
||||
class AbsoluteLimitsTests(base.BaseVolumeAdminTest): # noqa
|
||||
|
||||
# avoid existing volumes of pre-defined tenant
|
||||
force_tenant_isolation = True
|
||||
|
@ -273,6 +273,27 @@ def dont_use_config_in_tempest_lib(logical_line, filename):
|
||||
yield(0, msg)
|
||||
|
||||
|
||||
def dont_put_admin_tests_on_nonadmin_path(logical_line, physical_line,
|
||||
filename):
|
||||
"""Check admin tests should exist under admin path
|
||||
|
||||
T115
|
||||
"""
|
||||
|
||||
if 'tempest/api/' not in filename:
|
||||
return
|
||||
|
||||
if pep8.noqa(physical_line):
|
||||
return
|
||||
|
||||
if not re.match('class .*Test.*\(.*Admin.*\):', logical_line):
|
||||
return
|
||||
|
||||
if not re.match('.\/tempest\/api\/.*\/admin\/.*', filename):
|
||||
msg = 'T115: All admin tests should exist under admin path.'
|
||||
yield(0, msg)
|
||||
|
||||
|
||||
def factory(register):
|
||||
register(import_no_clients_in_api_and_scenario_tests)
|
||||
register(scenario_tests_need_service_tags)
|
||||
@ -287,3 +308,4 @@ def factory(register):
|
||||
register(dont_import_local_tempest_into_lib)
|
||||
register(dont_use_config_in_tempest_lib)
|
||||
register(use_rand_uuid_instead_of_uuid4)
|
||||
register(dont_put_admin_tests_on_nonadmin_path)
|
||||
|
Loading…
Reference in New Issue
Block a user