diff options
author | Cédric Ollivier <cedric.ollivier@orange.com> | 2018-03-07 14:02:08 +0100 |
---|---|---|
committer | Cédric Ollivier <cedric.ollivier@orange.com> | 2018-03-07 20:30:28 +0100 |
commit | 0174b1962464c289d777caa88c91ff2c20be910a (patch) | |
tree | 475928cf8ab88d14112ef21498ce6ab59273daa1 /functest/tests | |
parent | d2620ae72be08f83548be81fa80a418f2250da28 (diff) |
Allow overriding tempest output dir
Change-Id: I31a5d2772bab168b3cb4e6b0713d6e95aa5b6fd7
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Diffstat (limited to 'functest/tests')
-rw-r--r-- | functest/tests/unit/openstack/tempest/test_conf_utils.py | 11 | ||||
-rw-r--r-- | functest/tests/unit/openstack/tempest/test_tempest.py | 7 |
2 files changed, 10 insertions, 8 deletions
diff --git a/functest/tests/unit/openstack/tempest/test_conf_utils.py b/functest/tests/unit/openstack/tempest/test_conf_utils.py index 1d5f29a2c..1c9a8aeee 100644 --- a/functest/tests/unit/openstack/tempest/test_conf_utils.py +++ b/functest/tests/unit/openstack/tempest/test_conf_utils.py @@ -219,7 +219,8 @@ class OSTempestConfUtilsTesting(unittest.TestCase): 'conf_utils.os.makedirs') as mock_makedirs, \ mock.patch('functest.opnfv_tests.openstack.tempest.' 'conf_utils.shutil.copyfile') as mock_copyfile: - conf_utils.backup_tempest_config('test_conf_file') + conf_utils.backup_tempest_config( + 'test_conf_file', res_dir='test_dir') self.assertTrue(mock_makedirs.called) self.assertTrue(mock_copyfile.called) @@ -228,7 +229,8 @@ class OSTempestConfUtilsTesting(unittest.TestCase): return_value=True), \ mock.patch('functest.opnfv_tests.openstack.tempest.' 'conf_utils.shutil.copyfile') as mock_copyfile: - conf_utils.backup_tempest_config('test_conf_file') + conf_utils.backup_tempest_config( + 'test_conf_file', res_dir='test_dir') self.assertTrue(mock_copyfile.called) def test_conf_tempest_def(self): @@ -238,7 +240,7 @@ class OSTempestConfUtilsTesting(unittest.TestCase): mock.patch('functest.opnfv_tests.openstack.tempest.' 'conf_utils.configure_tempest_update_params')\ as mock_upd: - conf_utils.configure_tempest('test_dep_dir') + conf_utils.configure_tempest('test_dep_dir', 'test_dir') self.assertTrue(mock_upd.called) def test_gen_test_accounts_file_def(self): @@ -265,7 +267,8 @@ class OSTempestConfUtilsTesting(unittest.TestCase): return_value={'validation': {'ssh_timeout': 300}}): os.environ['OS_ENDPOINT_TYPE'] = '' conf_utils.configure_tempest_update_params( - 'test_conf_file', image_id=image_id, flavor_id=flavor_id) + 'test_conf_file', res_dir='test_dir', image_id=image_id, + flavor_id=flavor_id) mset.assert_any_call(params[0], params[1], params[2]) self.assertTrue(mread.called) self.assertTrue(mwrite.called) diff --git a/functest/tests/unit/openstack/tempest/test_tempest.py b/functest/tests/unit/openstack/tempest/test_tempest.py index 8600506ad..2b9dcff44 100644 --- a/functest/tests/unit/openstack/tempest/test_tempest.py +++ b/functest/tests/unit/openstack/tempest/test_tempest.py @@ -80,14 +80,13 @@ class OSTempestTesting(unittest.TestCase): testr_mode = r"'^tempest\.'" else: testr_mode = 'tempest.api.' + self.tempestcommon.mode - conf_utils.TEMPEST_RAW_LIST = 'raw_list' verifier_repo_dir = 'test_verifier_repo_dir' cmd = ("cd {0};" "testr list-tests {1} > {2};" "cd -;".format(verifier_repo_dir, testr_mode, - conf_utils.TEMPEST_RAW_LIST)) + self.tempestcommon.raw_list)) self.tempestcommon.generate_test_list('test_verifier_repo_dir') - mock_exec.assert_any_call(cmd) + mock_exec.assert_called_once_with(cmd) def test_gen_tl_smoke_mode(self): self._test_gen_tl_mode_default('smoke') @@ -146,7 +145,7 @@ class OSTempestTesting(unittest.TestCase): 'subprocess.Popen') def test_generate_report(self, mock_popen): self.tempestcommon.verification_id = "1234" - html_file = os.path.join(conf_utils.TEMPEST_RESULTS_DIR, + html_file = os.path.join(tempest.TempestCommon.TEMPEST_RESULTS_DIR, "tempest-report.html") cmd = ["rally", "verify", "report", "--type", "html", "--uuid", "1234", "--to", html_file] |