From 84d8296c5f28ad20f0e32cbfe5af36013da0a213 Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Fri, 17 Aug 2018 11:22:14 +0200 Subject: Clean /etc/rally.conf MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Else rally_sanity may print logs in tempest_smoke res dir. Change-Id: Iae97d533e9b99dcf8da70229b0675228472bfe52 Signed-off-by: Cédric Ollivier --- functest/opnfv_tests/openstack/tempest/tempest.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'functest/opnfv_tests/openstack/tempest/tempest.py') diff --git a/functest/opnfv_tests/openstack/tempest/tempest.py b/functest/opnfv_tests/openstack/tempest/tempest.py index 452c82d26..1182f2339 100644 --- a/functest/opnfv_tests/openstack/tempest/tempest.py +++ b/functest/opnfv_tests/openstack/tempest/tempest.py @@ -315,6 +315,22 @@ class TempestCommon(singlevm.VmReady1): with open(rally_conf, 'wb') as config_file: rconfig.write(config_file) + @staticmethod + def clean_rally_conf(rally_conf='/etc/rally/rally.conf'): + """Clean Rally config""" + rconfig = configparser.RawConfigParser() + rconfig.read(rally_conf) + if rconfig.has_option('tempest', 'img_name_regex'): + rconfig.remove_option('tempest', 'img_name_regex') + if rconfig.has_option('tempest', 'swift_operator_role'): + rconfig.remove_option('tempest', 'swift_operator_role') + if rconfig.has_option('DEFAULT', 'log-file'): + rconfig.remove_option('DEFAULT', 'log-file') + if rconfig.has_option('DEFAULT', 'log_dir'): + rconfig.remove_option('DEFAULT', 'log_dir') + 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 @@ -364,6 +380,7 @@ class TempestCommon(singlevm.VmReady1): """ Cleanup all OpenStack objects. Should be called on completion. """ + self.clean_rally_conf() if self.image_alt: self.cloud.delete_image(self.image_alt) if self.flavor_alt: -- cgit 1.2.3-korg