From 0acaa90002c7b9b19eb12db7a515ee3dce2a0243 Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Thu, 12 Apr 2018 20:58:01 +0200 Subject: Fix role processing in Patrole MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Role has to be listed in tempest.conf before calling testr. It also saves the right config file. Change-Id: Ifd122f31d0bfe3e9b3f93c6d62526acce96953d3 Signed-off-by: Cédric Ollivier (cherry picked from commit 71c4b3b719289929c226cae60eb1b23ada16eeb2) --- functest/opnfv_tests/openstack/tempest/tempest.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (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 22cb64c6b..9d001a82e 100644 --- a/functest/opnfv_tests/openstack/tempest/tempest.py +++ b/functest/opnfv_tests/openstack/tempest/tempest.py @@ -97,6 +97,16 @@ class TempestCommon(testcase.TestCase): result['num_failures'] = int(new_line[2]) return result + @staticmethod + def backup_tempest_config(conf_file, res_dir): + """ + Copy config file to tempest results directory + """ + if not os.path.exists(res_dir): + os.makedirs(res_dir) + shutil.copyfile(conf_file, + os.path.join(res_dir, 'tempest.conf')) + def generate_test_list(self): """Generate test list based on the test mode.""" LOGGER.debug("Generating test case list...") @@ -259,11 +269,11 @@ class TempestCommon(testcase.TestCase): self.resources.os_creds) self.conf_file = conf_utils.configure_verifier(self.deployment_dir) conf_utils.configure_tempest_update_params( - self.conf_file, self.res_dir, - network_name=resources.get("network_name"), + self.conf_file, network_name=resources.get("network_name"), image_id=resources.get("image_id"), flavor_id=resources.get("flavor_id"), compute_cnt=compute_cnt) + self.backup_tempest_config(self.conf_file, self.res_dir) def run(self, **kwargs): self.start_time = time.time() -- cgit 1.2.3-korg