X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=functest%2Fopnfv_tests%2Fopenstack%2Frally%2Frally.py;h=ac44de1184c5cd03daef47aebd231dc40777a695;hb=427547d5680878dabfa1e8d1e53fdb2921fd01ab;hp=0f74896d7f8b3c7bf44cf08844a051276453e610;hpb=985508f0d0612414be46165e9d1af42ad33a1143;p=functest.git diff --git a/functest/opnfv_tests/openstack/rally/rally.py b/functest/opnfv_tests/openstack/rally/rally.py index 0f74896d7..ac44de118 100644 --- a/functest/opnfv_tests/openstack/rally/rally.py +++ b/functest/opnfv_tests/openstack/rally/rally.py @@ -533,6 +533,11 @@ class RallyBase(singlevm.VmReady2): OS_PROJECT_NAME=self.project.project.name, OS_PROJECT_ID=self.project.project.id, OS_PASSWORD=self.project.password) + try: + del environ['OS_TENANT_NAME'] + del environ['OS_TENANT_ID'] + except Exception: # pylint: disable=broad-except + pass conf_utils.create_rally_deployment(environ=environ) self.prepare_run() self.run_tests() @@ -640,16 +645,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 +677,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()