diff options
author | Cédric Ollivier <cedric.ollivier@orange.com> | 2018-07-14 13:37:35 +0200 |
---|---|---|
committer | Cédric Ollivier <cedric.ollivier@orange.com> | 2018-07-26 18:51:28 +0200 |
commit | 5f2212689629ea3a434a242ad8e7822c492f71a8 (patch) | |
tree | 7135328749ee8f36736558f56e6557ca9a6e4437 /functest/opnfv_tests | |
parent | c1507df552b1178e0eeba1e764edbfaf996a68cf (diff) |
Set swift_operator_role if required
Apex creates member as default role which conflicts with the default
swift_operator_role [1]. It detects the default role in lowercase as
well and write it in rally.conf if required.
[1] https://build.opnfv.org/ci/view/functest/job/functest-apex-virtual-suite-master/116/console
Change-Id: Ic4dc98c793207fc32ff35852472742c92db6699c
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
(cherry picked from commit bafbd217c68c70ae66e052833c3e33298b35da0c)
Diffstat (limited to 'functest/opnfv_tests')
-rw-r--r-- | functest/opnfv_tests/openstack/tempest/tempest.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/functest/opnfv_tests/openstack/tempest/tempest.py b/functest/opnfv_tests/openstack/tempest/tempest.py index 23708cafe..15d834636 100644 --- a/functest/opnfv_tests/openstack/tempest/tempest.py +++ b/functest/opnfv_tests/openstack/tempest/tempest.py @@ -269,6 +269,19 @@ class TempestCommon(singlevm.VmReady1): with open(rally_conf, 'wb') as config_file: rconfig.write(config_file) + def update_default_role(self, rally_conf='/etc/rally/rally.conf'): + """Detect and update the default role if required""" + role = self.get_default_role(self.cloud) + if not role: + return + rconfig = configparser.RawConfigParser() + rconfig.read(rally_conf) + if not rconfig.has_section('tempest'): + rconfig.add_section('tempest') + rconfig.set('tempest', 'swift_operator_role', '^{}$'.format(role.name)) + with open(rally_conf, 'wb') as config_file: + rconfig.write(config_file) + def configure(self, **kwargs): # pylint: disable=unused-argument """ Create all openstack resources for tempest-based testcases and write @@ -299,6 +312,7 @@ class TempestCommon(singlevm.VmReady1): assert super(TempestCommon, self).run( **kwargs) == testcase.TestCase.EX_OK self.update_rally_regex() + self.update_default_role() self.configure(**kwargs) self.generate_test_list() self.apply_tempest_blacklist() |