diff options
author | houjingwen <houjingwen@huawei.com> | 2015-10-19 15:37:06 +0800 |
---|---|---|
committer | Hou Jingwen <houjingwen@huawei.com> | 2015-10-22 00:55:25 +0000 |
commit | e4e8688e0633ef22b2ff0ea8ba739313d5299ecc (patch) | |
tree | 0fee27d4e504b36e9eb24530cf85a0d33fd0b463 /tests/unit/benchmark/scenarios/networking/test_pktgen.py | |
parent | 9816c5aa786f7ec831c549b8ed4b5e8ef485da64 (diff) |
Update sla check for scenarios
This patch modify the question that SLA check result is not complete.
JIRA: YARDSTICK-172
Change-Id: I10438390baee92caf00dbfcdbdb833823ff8ce31
Signed-off-by: houjingwen <houjingwen@huawei.com>
Diffstat (limited to 'tests/unit/benchmark/scenarios/networking/test_pktgen.py')
-rw-r--r-- | tests/unit/benchmark/scenarios/networking/test_pktgen.py | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/tests/unit/benchmark/scenarios/networking/test_pktgen.py b/tests/unit/benchmark/scenarios/networking/test_pktgen.py index a20382cb7..ae4481f0e 100644 --- a/tests/unit/benchmark/scenarios/networking/test_pktgen.py +++ b/tests/unit/benchmark/scenarios/networking/test_pktgen.py @@ -113,6 +113,8 @@ class PktgenTestCase(unittest.TestCase): 'options': {'packetsize': 60, 'number_of_ports': 10}, 'ipaddr': '172.16.0.139' } + result = {} + p.server = mock_ssh.SSH() p.client = mock_ssh.SSH() @@ -124,7 +126,7 @@ class PktgenTestCase(unittest.TestCase): "packets_sent": 149776, "flows": 110}' mock_ssh.SSH().execute.return_value = (0, sample_output, '') - result = p.run(args) + p.run(args, result) expected_result = json.loads(sample_output) expected_result["packets_received"] = 149300 self.assertEqual(result, expected_result) @@ -137,6 +139,7 @@ class PktgenTestCase(unittest.TestCase): 'ipaddr': '172.16.0.139', 'sla': {'max_ppm': 10000} } + result = {} p.server = mock_ssh.SSH() p.client = mock_ssh.SSH() @@ -148,7 +151,7 @@ class PktgenTestCase(unittest.TestCase): "packets_sent": 149776, "flows": 110}' mock_ssh.SSH().execute.return_value = (0, sample_output, '') - result = p.run(args) + p.run(args, result) expected_result = json.loads(sample_output) expected_result["packets_received"] = 149300 self.assertEqual(result, expected_result) @@ -161,6 +164,8 @@ class PktgenTestCase(unittest.TestCase): 'ipaddr': '172.16.0.139', 'sla': {'max_ppm': 1000} } + result = {} + p.server = mock_ssh.SSH() p.client = mock_ssh.SSH() @@ -171,7 +176,7 @@ class PktgenTestCase(unittest.TestCase): sample_output = '{"packets_per_second": 9753, "errors": 0, \ "packets_sent": 149776, "flows": 110}' mock_ssh.SSH().execute.return_value = (0, sample_output, '') - self.assertRaises(AssertionError, p.run, args) + self.assertRaises(AssertionError, p.run, args, result) def test_pktgen_unsuccessful_script_error(self, mock_ssh): @@ -181,11 +186,13 @@ class PktgenTestCase(unittest.TestCase): 'ipaddr': '172.16.0.139', 'sla': {'max_ppm': 1000} } + result = {} + p.server = mock_ssh.SSH() p.client = mock_ssh.SSH() mock_ssh.SSH().execute.return_value = (1, '', 'FOOBAR') - self.assertRaises(RuntimeError, p.run, args) + self.assertRaises(RuntimeError, p.run, args, result) def main(): |