diff options
author | Juha Kosonen <juha.kosonen@nokia.com> | 2017-11-20 19:56:28 +0200 |
---|---|---|
committer | Juha Kosonen <juha.kosonen@nokia.com> | 2017-11-21 16:04:28 +0000 |
commit | a508c431dd66aa86b27b06da716ffe6a8b63409c (patch) | |
tree | f163c0d4d8210e4ab5df6c47061866c5199dfa3a /functest/tests/unit/openstack/rally | |
parent | 777acd341ff407838440dae3ed69291ec4c52626 (diff) |
Fix "Broken pipe" IOErrors of rally run
Replace obsolete os.popen with subprocess module usage in command
output retrieval. Do not use shell as the program to execute.
Change-Id: Ic63bb0f393750c3b85a35a37fecd46c1c1b96602
Signed-off-by: Juha Kosonen <juha.kosonen@nokia.com>
(cherry picked from commit 8335acdf080e4d31fd1dd70f11aa456b4795833a)
Diffstat (limited to 'functest/tests/unit/openstack/rally')
-rw-r--r-- | functest/tests/unit/openstack/rally/test_rally.py | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/functest/tests/unit/openstack/rally/test_rally.py b/functest/tests/unit/openstack/rally/test_rally.py index 6a85536da..2e52d7bec 100644 --- a/functest/tests/unit/openstack/rally/test_rally.py +++ b/functest/tests/unit/openstack/rally/test_rally.py @@ -260,13 +260,10 @@ class OSRallyTesting(unittest.TestCase): return_value=True) @mock.patch('functest.opnfv_tests.openstack.rally.rally.subprocess.Popen') @mock.patch('functest.opnfv_tests.openstack.rally.rally.os.makedirs') - @mock.patch('functest.opnfv_tests.openstack.rally.rally.os.popen') @mock.patch('functest.opnfv_tests.openstack.rally.rally.LOGGER.info') @mock.patch('functest.opnfv_tests.openstack.rally.rally.LOGGER.error') def test_run_task_default(self, mock_logger_error, mock_logger_info, - mock_popen, *args): - attrs = {'read.return_value': 'json_result'} - mock_popen.return_value.configure_mock(**attrs) + *args): self.rally_base._run_task('test_name') text = 'Test scenario: "test_name" OK.\n' mock_logger_info.assert_any_call(text) |