aboutsummaryrefslogtreecommitdiffstats
path: root/functest/opnfv_tests/openstack/tempest/tempest.py
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2018-08-17 11:22:14 +0200
committerCédric Ollivier <cedric.ollivier@orange.com>2018-08-17 11:22:14 +0200
commit84d8296c5f28ad20f0e32cbfe5af36013da0a213 (patch)
tree159554b14371b2cbe53d381e0fb459e427854d42 /functest/opnfv_tests/openstack/tempest/tempest.py
parent2eee07c6e775eadcdc32ad77a90b386b83cda5ba (diff)
Clean /etc/rally.conf
Else rally_sanity may print logs in tempest_smoke res dir. Change-Id: Iae97d533e9b99dcf8da70229b0675228472bfe52 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Diffstat (limited to 'functest/opnfv_tests/openstack/tempest/tempest.py')
-rw-r--r--functest/opnfv_tests/openstack/tempest/tempest.py17
1 files changed, 17 insertions, 0 deletions
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: