aboutsummaryrefslogtreecommitdiffstats
path: root/functest/tests
diff options
context:
space:
mode:
authorJuha Kosonen <juha.kosonen@nokia.com>2018-08-10 16:43:24 +0300
committerJuha Kosonen <juha.kosonen@nokia.com>2018-08-10 16:43:24 +0300
commit38a61f9112cec92be1103276798f8500871b62e4 (patch)
treee56a4be0f52a16b623d4f2c129a8f08f64fd62de /functest/tests
parentddf30512b98745460c1d162a54a18b0a8a814912 (diff)
Remove explicit Rally task validation
Utilize the output of Rally task execution since it internally validates the task. Use Popen.communicate to get the output from the running Rally task. Change-Id: I9b1299bc26129ff4f89adccec611c78195a3ab02 Signed-off-by: Juha Kosonen <juha.kosonen@nokia.com>
Diffstat (limited to 'functest/tests')
-rw-r--r--functest/tests/unit/openstack/rally/test_rally.py15
1 files changed, 1 insertions, 14 deletions
diff --git a/functest/tests/unit/openstack/rally/test_rally.py b/functest/tests/unit/openstack/rally/test_rally.py
index b49fe627a..1a43e561d 100644
--- a/functest/tests/unit/openstack/rally/test_rally.py
+++ b/functest/tests/unit/openstack/rally/test_rally.py
@@ -104,12 +104,6 @@ class OSRallyTesting(unittest.TestCase):
self.assertEqual(self.rally_base.task_succeed(json_raw),
True)
- def test_get_cmd_output(self):
- proc = mock.Mock()
- proc.stdout.__iter__ = mock.Mock(return_value=iter(['line1', 'line2']))
- self.assertEqual(self.rally_base.get_cmd_output(proc),
- 'line1line2')
-
@mock.patch('six.moves.builtins.open', mock.mock_open())
@mock.patch('functest.opnfv_tests.openstack.rally.rally.yaml.safe_load',
return_value={'scenario': [
@@ -222,8 +216,6 @@ class OSRallyTesting(unittest.TestCase):
'_build_task_args', return_value={})
@mock.patch('functest.opnfv_tests.openstack.rally.rally.RallyBase.'
'get_task_id', return_value=None)
- @mock.patch('functest.opnfv_tests.openstack.rally.rally.RallyBase.'
- 'get_cmd_output', return_value='')
@mock.patch('functest.opnfv_tests.openstack.rally.rally.os.path.exists',
return_value=True)
@mock.patch('functest.opnfv_tests.openstack.rally.rally.subprocess.Popen')
@@ -232,7 +224,7 @@ class OSRallyTesting(unittest.TestCase):
# pylint: disable=unused-argument
with self.assertRaises(Exception):
self.rally_base._run_task('test_name')
- text = 'Failed to retrieve task_id, validating task...'
+ text = 'Failed to retrieve task_id'
mock_logger_error.assert_any_call(text)
@mock.patch('six.moves.builtins.open', mock.mock_open())
@@ -245,8 +237,6 @@ class OSRallyTesting(unittest.TestCase):
@mock.patch('functest.opnfv_tests.openstack.rally.rally.RallyBase.'
'get_task_id', return_value='1')
@mock.patch('functest.opnfv_tests.openstack.rally.rally.RallyBase.'
- 'get_cmd_output', return_value='')
- @mock.patch('functest.opnfv_tests.openstack.rally.rally.RallyBase.'
'task_succeed', return_value=True)
@mock.patch('functest.opnfv_tests.openstack.rally.rally.os.path.exists',
return_value=True)
@@ -264,12 +254,9 @@ class OSRallyTesting(unittest.TestCase):
@mock.patch('six.moves.builtins.open', mock.mock_open())
@mock.patch('functest.opnfv_tests.openstack.rally.rally.RallyBase.'
'task_succeed', return_value=True)
- @mock.patch('functest.opnfv_tests.openstack.rally.rally.RallyBase.'
- 'get_cmd_output', return_value='')
@mock.patch('functest.opnfv_tests.openstack.rally.rally.os.path.exists',
return_value=True)
@mock.patch('subprocess.check_output')
- @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.LOGGER.info')
@mock.patch('functest.opnfv_tests.openstack.rally.rally.LOGGER.debug')