Merge "Functional tests: optionally skip admin actions in setups"
This commit is contained in:
commit
fa19a42ec3
|
@ -75,6 +75,12 @@ The config file should look like the following:
|
|||
# the tests will verify changes propagate out to these nameservers
|
||||
nameservers = 127.0.0.1:53,127.0.0.2:53
|
||||
|
||||
[testconfig]
|
||||
# if true, make requests to {url}/v2/zones instead of {url}/zones
|
||||
append_version_to_url = True
|
||||
# if true, skip doing admin actions like increasing quotas in test setups
|
||||
no_admin_setup = False
|
||||
|
||||
|
||||
Running the tests
|
||||
=================
|
||||
|
|
|
@ -15,6 +15,7 @@ limitations under the License.
|
|||
"""
|
||||
|
||||
from tempest_lib import exceptions
|
||||
from oslo_config import cfg
|
||||
|
||||
from functionaltests.api.v2.clients.quotas_client import QuotasClient
|
||||
from functionaltests.api.v2.models.quotas_model import QuotasModel
|
||||
|
@ -27,6 +28,8 @@ class DesignateV2Test(BaseDesignateTest):
|
|||
super(DesignateV2Test, self).__init__(*args, **kwargs)
|
||||
|
||||
def increase_quotas(self, user):
|
||||
if cfg.CONF.testconfig.no_admin_setup:
|
||||
return
|
||||
QuotasClient.as_user('admin').patch_quotas(
|
||||
QuotasClient.as_user(user).tenant_id,
|
||||
QuotasModel.from_dict({
|
||||
|
|
|
@ -39,8 +39,9 @@ class TransferRequestClient(ClientMixin):
|
|||
|
||||
@classmethod
|
||||
def transfer_request_uri(cls, transfer_request_id):
|
||||
return "/v2/zones/tasks/transfer_requests/{0}".format(
|
||||
transfer_request_id)
|
||||
return cls.create_uri(
|
||||
"/zones/tasks/transfer_requests/{0}".format(transfer_request_id)
|
||||
)
|
||||
|
||||
def list_transfer_requests(self, filters=None, **kwargs):
|
||||
resp, body = self.client.get(
|
||||
|
|
|
@ -187,7 +187,7 @@ class ClientMixin(object):
|
|||
|
||||
@classmethod
|
||||
def create_uri(cls, path, filters=None):
|
||||
if cfg.CONF.identity.append_version_to_url:
|
||||
if cfg.CONF.testconfig.append_version_to_url:
|
||||
uri = "/v2/{0}".format(path)
|
||||
else:
|
||||
uri = path
|
||||
|
|
|
@ -26,11 +26,13 @@ cfg.CONF.register_group(cfg.OptGroup(
|
|||
name='noauth', title="Configuration to run tests without Keystone"
|
||||
))
|
||||
|
||||
cfg.CONF.register_group(cfg.OptGroup(
|
||||
name='testconfig', title="Configuration to customize how the tests run"
|
||||
))
|
||||
|
||||
cfg.CONF.register_opts([
|
||||
cfg.StrOpt('designate_override_url',
|
||||
help="Use this instead of the endpoint in the service catalog"),
|
||||
cfg.BoolOpt('append_version_to_url', default=True,
|
||||
help="Post to url + /v2/zones instead of url + /zones"),
|
||||
|
||||
cfg.StrOpt('uri', help="The Keystone v2 endpoint"),
|
||||
cfg.StrOpt('uri_v3', help="The Keystone v3 endpoint"),
|
||||
|
@ -61,12 +63,19 @@ cfg.CONF.register_opts([
|
|||
cfg.BoolOpt('use_noauth', default=False),
|
||||
], group='noauth')
|
||||
|
||||
|
||||
cfg.CONF.register_opts([
|
||||
cfg.ListOpt('nameservers', default=["127.0.0.1:53"])
|
||||
], group="designate")
|
||||
|
||||
|
||||
cfg.CONF.register_opts([
|
||||
cfg.BoolOpt('append_version_to_url', default=True,
|
||||
help="Post to url + /v2/zones instead of url + /zones"),
|
||||
cfg.BoolOpt('no_admin_setup', default=False,
|
||||
help="Skip admin actions (like increasing quotas) in setUp()")
|
||||
], group='testconfig')
|
||||
|
||||
|
||||
def find_config_file():
|
||||
return os.environ.get(
|
||||
'TEMPEST_CONFIG', '/opt/stack/tempest/etc/tempest.conf')
|
||||
|
|
Loading…
Reference in New Issue