summaryrefslogtreecommitdiffstats
path: root/tests/unit/benchmark/scenarios/networking/test_netperf.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/benchmark/scenarios/networking/test_netperf.py')
-rwxr-xr-xtests/unit/benchmark/scenarios/networking/test_netperf.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/unit/benchmark/scenarios/networking/test_netperf.py b/tests/unit/benchmark/scenarios/networking/test_netperf.py
index d5c19918b..4bb5983c3 100755
--- a/tests/unit/benchmark/scenarios/networking/test_netperf.py
+++ b/tests/unit/benchmark/scenarios/networking/test_netperf.py
@@ -48,11 +48,12 @@ class NetperfTestCase(unittest.TestCase):
options = {}
args = {'options': options}
+ result = {}
sample_output = self._read_sample_output()
mock_ssh.SSH().execute.return_value = (0, sample_output, '')
expected_result = json.loads(sample_output)
- result = p.run(args)
+ p.run(args, result)
self.assertEqual(result, expected_result)
def test_netperf_successful_sla(self, mock_ssh):
@@ -66,11 +67,12 @@ class NetperfTestCase(unittest.TestCase):
'options': options,
'sla': {'mean_latency': 100}
}
+ result = {}
sample_output = self._read_sample_output()
mock_ssh.SSH().execute.return_value = (0, sample_output, '')
expected_result = json.loads(sample_output)
- result = p.run(args)
+ p.run(args, result)
self.assertEqual(result, expected_result)
def test_netperf_unsuccessful_sla(self, mock_ssh):
@@ -84,10 +86,11 @@ class NetperfTestCase(unittest.TestCase):
'options': options,
'sla': {'mean_latency': 5}
}
+ result = {}
sample_output = self._read_sample_output()
mock_ssh.SSH().execute.return_value = (0, sample_output, '')
- self.assertRaises(AssertionError, p.run, args)
+ self.assertRaises(AssertionError, p.run, args, result)
def test_netperf_unsuccessful_script_error(self, mock_ssh):
@@ -97,9 +100,10 @@ class NetperfTestCase(unittest.TestCase):
options = {}
args = {'options': options}
+ result = {}
mock_ssh.SSH().execute.return_value = (1, '', 'FOOBAR')
- self.assertRaises(RuntimeError, p.run, args)
+ self.assertRaises(RuntimeError, p.run, args, result)
def _read_sample_output(self):
curr_path = os.path.dirname(os.path.abspath(__file__))