From bc88eff8f5850f8207431bb8d1958fe6b9cd09e8 Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Sun, 2 Jun 2019 14:43:10 +0200 Subject: Publish rally logs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Both Rally and Tempest publish Rally debug logs. It also moves the logics from tempest to rally. Change-Id: I5c057d830202baddd73577ade1b09ce304e3c5a5 Signed-off-by: Cédric Ollivier --- functest/tests/unit/openstack/rally/test_rally.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'functest/tests/unit') diff --git a/functest/tests/unit/openstack/rally/test_rally.py b/functest/tests/unit/openstack/rally/test_rally.py index 83332c86f..ac52b87eb 100644 --- a/functest/tests/unit/openstack/rally/test_rally.py +++ b/functest/tests/unit/openstack/rally/test_rally.py @@ -325,13 +325,18 @@ class OSRallyTesting(unittest.TestCase): mock_run_task.assert_any_call('test1') mock_run_task.assert_any_call('test2') - def test_clean_up_default(self): + @mock.patch('functest.opnfv_tests.openstack.rally.rally.RallyBase.' + 'clean_rally_logs') + def test_clean_up_default(self, *args): with mock.patch.object(self.rally_base.orig_cloud, 'delete_flavor') as mock_delete_flavor: self.rally_base.flavor_alt = mock.Mock() self.rally_base.clean() self.assertEqual(mock_delete_flavor.call_count, 1) + args[0].assert_called_once_with() + @mock.patch('functest.opnfv_tests.openstack.rally.rally.RallyBase.' + 'update_rally_logs') @mock.patch('functest.opnfv_tests.openstack.rally.rally.RallyBase.' 'create_rally_deployment') @mock.patch('functest.opnfv_tests.openstack.rally.rally.RallyBase.' @@ -347,12 +352,17 @@ class OSRallyTesting(unittest.TestCase): for func in args: func.assert_called() + @mock.patch('functest.opnfv_tests.openstack.rally.rally.RallyBase.' + 'update_rally_logs') @mock.patch('functest.opnfv_tests.openstack.rally.rally.RallyBase.' 'create_rally_deployment', side_effect=Exception) - def test_run_exception_create_rally_dep(self, mock_create_rally_dep): + def test_run_exception_create_rally_dep(self, *args): self.assertEqual(self.rally_base.run(), testcase.TestCase.EX_RUN_ERROR) - mock_create_rally_dep.assert_called() + args[0].assert_called() + args[1].assert_called_once_with(self.rally_base.res_dir) + @mock.patch('functest.opnfv_tests.openstack.rally.rally.RallyBase.' + 'update_rally_logs') @mock.patch('functest.opnfv_tests.openstack.rally.rally.RallyBase.' 'create_rally_deployment', return_value=mock.Mock()) @mock.patch('functest.opnfv_tests.openstack.rally.rally.RallyBase.' @@ -361,6 +371,7 @@ class OSRallyTesting(unittest.TestCase): # pylint: disable=unused-argument self.assertEqual(self.rally_base.run(), testcase.TestCase.EX_RUN_ERROR) mock_prep_env.assert_called() + args[1].assert_called_once_with(self.rally_base.res_dir) def test_append_summary(self): json_dict = { -- cgit 1.2.3-korg