From 51f3e7a3cc4409fb9dda03bffa1252a8660f38b0 Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Fri, 20 Jul 2018 10:45:20 +0200 Subject: Allow overriding the default role MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- functest/opnfv_tests/vnf/epc/juju_epc.py | 7 +++++++ functest/opnfv_tests/vnf/ims/cloudify_ims.py | 8 ++++++++ 2 files changed, 15 insertions(+) (limited to 'functest/opnfv_tests/vnf') 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 " @@ -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 -- cgit 1.2.3-korg