diff options
author | Ross Brattain <ross.b.brattain@intel.com> | 2017-10-12 00:45:26 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2017-10-12 00:45:26 +0000 |
commit | 5721849f3f08c2c1c89354341115c834e510b3d6 (patch) | |
tree | 19a1fdb5c4067c0e7113533e84f2f500e95888a8 /tests/unit/benchmark/scenarios/networking | |
parent | eab7e0f4b1ffb895a93107ab28b26ceb3b084e99 (diff) | |
parent | 10f85b332c4b1f55e651aeb9c45b328e1ebdc2af (diff) |
Merge "Use "protocol" parameters in iperf3 yaml and task file"
Diffstat (limited to 'tests/unit/benchmark/scenarios/networking')
-rw-r--r-- | tests/unit/benchmark/scenarios/networking/test_iperf3.py | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/tests/unit/benchmark/scenarios/networking/test_iperf3.py b/tests/unit/benchmark/scenarios/networking/test_iperf3.py index 331245357..4d3745230 100644 --- a/tests/unit/benchmark/scenarios/networking/test_iperf3.py +++ b/tests/unit/benchmark/scenarios/networking/test_iperf3.py @@ -123,7 +123,7 @@ class IperfTestCase(unittest.TestCase): self.assertRaises(AssertionError, p.run, result) def test_iperf_successful_sla_jitter(self, mock_ssh): - options = {"udp": "udp", "bandwidth": "20m"} + options = {"protocol": "udp", "bandwidth": "20m"} args = { 'options': options, 'sla': {'jitter': 10} @@ -141,7 +141,7 @@ class IperfTestCase(unittest.TestCase): self.assertEqual(result, expected_result) def test_iperf_unsuccessful_sla_jitter(self, mock_ssh): - options = {"udp": "udp", "bandwidth": "20m"} + options = {"protocol": "udp", "bandwidth": "20m"} args = { 'options': options, 'sla': {'jitter': 0.0001} @@ -156,6 +156,24 @@ class IperfTestCase(unittest.TestCase): mock_ssh.SSH.from_node().execute.return_value = (0, sample_output, '') self.assertRaises(AssertionError, p.run, result) + def test_iperf_successful_tcp_protocal(self, mock_ssh): + options = {"protocol": "tcp", "nodelay": "yes"} + args = { + 'options': options, + 'sla': {'bytes_per_second': 15000000} + } + result = {} + + p = iperf3.Iperf(args, self.ctx) + mock_ssh.SSH.from_node().execute.return_value = (0, '', '') + p.host = mock_ssh.SSH.from_node() + + sample_output = self._read_sample_output(self.output_name_tcp) + mock_ssh.SSH.from_node().execute.return_value = (0, sample_output, '') + expected_result = utils.flatten_dict_key(jsonutils.loads(sample_output)) + p.run(result) + self.assertEqual(result, expected_result) + def test_iperf_unsuccessful_script_error(self, mock_ssh): options = {} |