summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2018-09-21 17:25:44 +0200
committerCédric Ollivier <cedric.ollivier@orange.com>2018-09-21 20:06:24 +0200
commita34a7d738e1fd8c8b889e48c0b170008be3601e8 (patch)
tree56593b9012fa0e2a362ef69b5f0898604580fe84
parent8da46bb8dc9a634dd7b56657c52581dfe8168a41 (diff)
Remove rally plugins and extra when cleaning
Change-Id: I15393b870d648432c900d429d17129c630ed4f58 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com> (cherry picked from commit aff6640b5aed37221a05067e93ee164273c16910)
-rw-r--r--functest/opnfv_tests/openstack/rally/rally.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/functest/opnfv_tests/openstack/rally/rally.py b/functest/opnfv_tests/openstack/rally/rally.py
index 0f74896d7..e5cdf9fe8 100644
--- a/functest/opnfv_tests/openstack/rally/rally.py
+++ b/functest/opnfv_tests/openstack/rally/rally.py
@@ -640,16 +640,21 @@ class RallyJobs(RallyBase):
with open(result_file_name, 'w') as fname:
template.dump(cases, fname)
- def prepare_task(self, test_name):
- """Prepare resources for test run."""
+ @staticmethod
+ def _remove_plugins_extra():
inst_dir = getattr(config.CONF, 'dir_rally_inst')
try:
shutil.rmtree(os.path.join(inst_dir, 'plugins'))
shutil.rmtree(os.path.join(inst_dir, 'extra'))
except Exception: # pylint: disable=broad-except
pass
+
+ def prepare_task(self, test_name):
+ """Prepare resources for test run."""
+ self._remove_plugins_extra()
jobs_dir = os.path.join(
getattr(config.CONF, 'dir_rally_data'), test_name, 'rally-jobs')
+ inst_dir = getattr(config.CONF, 'dir_rally_inst')
shutil.copytree(os.path.join(jobs_dir, 'plugins'),
os.path.join(inst_dir, 'plugins'))
shutil.copytree(os.path.join(jobs_dir, 'extra'),
@@ -667,3 +672,7 @@ class RallyJobs(RallyBase):
self.apply_blacklist(task, task_file_name)
self.run_cmd = (["rally", "task", "start", "--task", task_file_name])
return True
+
+ def clean(self):
+ self._remove_plugins_extra()
+ super(RallyJobs, self).clean()