aboutsummaryrefslogtreecommitdiffstats
path: root/functest/opnfv_tests/vnf
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2018-07-20 10:45:20 +0200
committerCédric Ollivier <cedric.ollivier@orange.com>2018-07-20 11:20:58 +0200
commit51f3e7a3cc4409fb9dda03bffa1252a8660f38b0 (patch)
treeec03a206710003bc15bf9f665eaf4e5d8cb07211 /functest/opnfv_tests/vnf
parent5bd8c86c423e59c7a24b15b9855f9e04ba8500c5 (diff)
Allow overriding the default role
It allows testing controllers which implements other RBAC policies. Defining NEW_USER_ROLE=admin will easily raise side effects for orchestrators such as Juju and Cloudify. Change-Id: Ia78a25381aeb8aa81fd1872661629e1c08432b8f Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Diffstat (limited to 'functest/opnfv_tests/vnf')
-rw-r--r--functest/opnfv_tests/vnf/epc/juju_epc.py7
-rw-r--r--functest/opnfv_tests/vnf/ims/cloudify_ims.py8
2 files changed, 15 insertions, 0 deletions
diff --git a/functest/opnfv_tests/vnf/epc/juju_epc.py b/functest/opnfv_tests/vnf/epc/juju_epc.py
index 3f2a9ff93..6fcae680a 100644
--- a/functest/opnfv_tests/vnf/epc/juju_epc.py
+++ b/functest/opnfv_tests/vnf/epc/juju_epc.py
@@ -131,6 +131,13 @@ class JujuEpc(vnf.VnfOnBoarding):
self.res_dir = os.path.join(
getattr(config.CONF, 'dir_results'), self.case_name)
+ def check_requirements(self):
+ if env.get('NEW_USER_ROLE').lower() == "admin":
+ self.__logger.warn(
+ "Defining NEW_USER_ROLE=admin will easily break the testcase "
+ "because Juju doesn't manage tenancy (e.g. subnet "
+ "overlapping)")
+
def _bypass_juju_netdiscovery_bug(self, name):
user_creator = OpenStackUser(
self.snaps_creds,
diff --git a/functest/opnfv_tests/vnf/ims/cloudify_ims.py b/functest/opnfv_tests/vnf/ims/cloudify_ims.py
index 9786ff271..36862bd43 100644
--- a/functest/opnfv_tests/vnf/ims/cloudify_ims.py
+++ b/functest/opnfv_tests/vnf/ims/cloudify_ims.py
@@ -24,6 +24,7 @@ import six
from functest.core import cloudify
from functest.opnfv_tests.vnf.ims import clearwater_ims_base
from functest.utils import config
+from functest.utils import env
__author__ = "Valentin Boucher <valentin.boucher@orange.com>"
@@ -90,6 +91,13 @@ class CloudifyIms(cloudify.Cloudify):
self.image_alt = None
self.flavor_alt = None
+ def check_requirements(self):
+ if env.get('NEW_USER_ROLE').lower() == "admin":
+ self.__logger.warn(
+ "Defining NEW_USER_ROLE=admin will easily break the testcase "
+ "because Cloudify doesn't manage tenancy (e.g. subnet "
+ "overlapping)")
+
def execute(self):
assert super(CloudifyIms, self).execute() == 0
# pylint: disable=too-many-locals,too-many-statements