Provide fixes to tungten/patrole plugins
This is needed to run contrail tests
Tungsten part of fixes:
1. Added get_auth_providers method to use in tests
2. Modified resource_setup method to do not fail
if project already exists. In our case it has created
by tempest plugin
3. Remove check for CONF.patrole.enable_rbac due to deprecation of
this parameter in next version of patrole plugin.
Added .gitreview
Change-Id: I4d60fb5c285a0a6dfa9897c74876ac513da15033
Related-PROD: PROD-23985
diff --git a/.gitreview b/.gitreview
new file mode 100644
index 0000000..e4aaefb
--- /dev/null
+++ b/.gitreview
@@ -0,0 +1,4 @@
+[gerrit]
+host=gerrit.mcp.mirantis.com
+port=29418
+project=contrail/tungsten-tempest
diff --git a/requirements.txt b/requirements.txt
index 84d7047..1803e54 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -2,6 +2,6 @@
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.
-Patrole>=0.2.0
+https://gerrit.mcp.mirantis.net/packaging/sources/patrole@0.4.x
pylint
diff --git a/tungsten_tempest_plugin/tests/api/contrail/rbac_base.py b/tungsten_tempest_plugin/tests/api/contrail/rbac_base.py
index d0137c2..2685c39 100644
--- a/tungsten_tempest_plugin/tests/api/contrail/rbac_base.py
+++ b/tungsten_tempest_plugin/tests/api/contrail/rbac_base.py
@@ -110,9 +110,6 @@
super(BaseContrailTest, cls).skip_checks()
if not CONF.service_available.contrail:
raise cls.skipException("Contrail support is required")
- if not CONF.patrole.enable_rbac:
- raise cls.skipException(
- "%s skipped as RBAC Flag not enabled" % cls.__name__)
if CONF.auth.tempest_roles != ['admin']:
raise cls.skipException(
"%s skipped because tempest roles is not admin" % cls.__name__)
@@ -122,6 +119,11 @@
super(BaseContrailTest, cls).setup_credentials()
@classmethod
+ def get_auth_providers(cls):
+ auth_provider = getattr(cls, 'auth_provider', None)
+ return [auth_provider] if auth_provider is not None else []
+
+ @classmethod
def setup_clients(cls):
super(BaseContrailTest, cls).setup_clients()
cls.auth_provider = cls.os_primary.auth_provider
@@ -384,8 +386,14 @@
'parent_type': 'domain',
'fq_name': ['default-domain', cls.tenant_name]
}
- resp_body = cls.project_client.create_projects(**post_body)
- cls.project_uuid = resp_body['project']['uuid']
+ try:
+ resp_body = cls.project_client.create_projects(**post_body)
+ cls.project_uuid = resp_body['project']['uuid']
+ except exceptions.Conflict:
+ resp_body = cls.project_client.list_projects()
+ for project in resp_body['projects']:
+ if cls.tenant_name in project['fq_name']:
+ cls.project_uuid = project['uuid']
@classmethod
def resource_cleanup(cls):