From 8700960a0edf662734259273ca002f2ac2050e21 Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Sat, 10 Mar 2018 13:34:43 +0100 Subject: Enhance patrole configurations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It allows listing the OpenStack services tested or setting test exlusions (e.g. tests requiring GRE as overlay). It should be noted that Keystone and Nova can't currently be tested without their default policy.json. Change-Id: I8909694b4ffc315959504441f5ea0b1f3023fe7c Signed-off-by: Cédric Ollivier --- docker/patrole/testcases.yaml | 6 ++++++ functest/opnfv_tests/openstack/patrole/patrole.py | 6 ++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/docker/patrole/testcases.yaml b/docker/patrole/testcases.yaml index 5615a9055..5d9199cdc 100644 --- a/docker/patrole/testcases.yaml +++ b/docker/patrole/testcases.yaml @@ -22,3 +22,9 @@ tiers: class: 'Patrole' args: role: 'admin' + services: + - 'image' + - 'network' + - 'volume' + exclude: + - 'test_networks_multiprovider_rbac' diff --git a/functest/opnfv_tests/openstack/patrole/patrole.py b/functest/opnfv_tests/openstack/patrole/patrole.py index 8f30c482d..1f1674564 100644 --- a/functest/opnfv_tests/openstack/patrole/patrole.py +++ b/functest/opnfv_tests/openstack/patrole/patrole.py @@ -29,8 +29,6 @@ class Patrole(tempest.TempestCommon): if "case_name" not in kwargs: kwargs["case_name"] = 'patrole' super(Patrole, self).__init__(**kwargs) - self.mode = ("'(?!.*test_networks_multiprovider_rbac)" - "(?=patrole_tempest_plugin.tests.api.(image|network))'") self.res_dir = os.path.join( getattr(config.CONF, 'dir_results'), 'patrole') self.raw_list = os.path.join(self.res_dir, 'test_raw_list.txt') @@ -38,6 +36,10 @@ class Patrole(tempest.TempestCommon): def run(self, **kwargs): self.start_time = time.time() + for exclude in kwargs.get('exclude', []): + self.mode = "{}(?!.*{})".format(self.mode, exclude) + self.mode = "'{}(?=patrole_tempest_plugin.tests.api.({}))'".format( + self.mode, '|'.join(kwargs.get('services', []))) try: if not os.path.exists(self.res_dir): os.makedirs(self.res_dir) -- cgit 1.2.3-korg