summaryrefslogtreecommitdiffstats
path: root/tests/unit/benchmark/scenarios/compute/test_unixbench.py
diff options
context:
space:
mode:
authorJing Lu <lvjing5@huawei.com>2017-05-04 12:59:04 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-05-04 12:59:04 +0000
commit20f5b0a8580c0e8c659424bab434a0e30f3c88c1 (patch)
treef683654bf3247b4d5c8903ed01eb6415105e9248 /tests/unit/benchmark/scenarios/compute/test_unixbench.py
parent058f0a93fd37694b74c5f1414bdfa6b35114690a (diff)
parent150481286dcf3c3c1fedd8213070cff48e5ad61d (diff)
Merge "standardize ssh auth" into stable/danube
Diffstat (limited to 'tests/unit/benchmark/scenarios/compute/test_unixbench.py')
-rw-r--r--tests/unit/benchmark/scenarios/compute/test_unixbench.py26
1 files changed, 13 insertions, 13 deletions
diff --git a/tests/unit/benchmark/scenarios/compute/test_unixbench.py b/tests/unit/benchmark/scenarios/compute/test_unixbench.py
index 747bda1ed..7d071e91c 100644
--- a/tests/unit/benchmark/scenarios/compute/test_unixbench.py
+++ b/tests/unit/benchmark/scenarios/compute/test_unixbench.py
@@ -38,7 +38,7 @@ class UnixbenchTestCase(unittest.TestCase):
u = unixbench.Unixbench({}, self.ctx)
u.setup()
- mock_ssh.SSH().execute.return_value = (0, '', '')
+ mock_ssh.SSH.from_node().execute.return_value = (0, '', '')
self.assertIsNotNone(u.client)
self.assertEqual(u.setup_done, True)
@@ -54,10 +54,10 @@ class UnixbenchTestCase(unittest.TestCase):
u = unixbench.Unixbench(args, self.ctx)
result = {}
- u.server = mock_ssh.SSH()
+ u.server = mock_ssh.SSH.from_node()
sample_output = '{"Score":"4425.4"}'
- mock_ssh.SSH().execute.return_value = (0, sample_output, '')
+ mock_ssh.SSH.from_node().execute.return_value = (0, sample_output, '')
u.run(result)
expected_result = jsonutils.loads(sample_output)
@@ -76,10 +76,10 @@ class UnixbenchTestCase(unittest.TestCase):
u = unixbench.Unixbench(args, self.ctx)
result = {}
- u.server = mock_ssh.SSH()
+ u.server = mock_ssh.SSH.from_node()
sample_output = '{"Score":"4425.4"}'
- mock_ssh.SSH().execute.return_value = (0, sample_output, '')
+ mock_ssh.SSH.from_node().execute.return_value = (0, sample_output, '')
u.run(result)
expected_result = jsonutils.loads(sample_output)
@@ -102,10 +102,10 @@ class UnixbenchTestCase(unittest.TestCase):
u = unixbench.Unixbench(args, self.ctx)
result = {}
- u.server = mock_ssh.SSH()
+ u.server = mock_ssh.SSH.from_node()
sample_output = '{"signle_score":"2251.7","parallel_score":"4395.9"}'
- mock_ssh.SSH().execute.return_value = (0, sample_output, '')
+ mock_ssh.SSH.from_node().execute.return_value = (0, sample_output, '')
u.run(result)
expected_result = jsonutils.loads(sample_output)
@@ -120,10 +120,10 @@ class UnixbenchTestCase(unittest.TestCase):
u = unixbench.Unixbench(args, self.ctx)
result = {}
- u.server = mock_ssh.SSH()
+ u.server = mock_ssh.SSH.from_node()
sample_output = '{"single_score":"200.7","parallel_score":"4395.9"}'
- mock_ssh.SSH().execute.return_value = (0, sample_output, '')
+ mock_ssh.SSH.from_node().execute.return_value = (0, sample_output, '')
self.assertRaises(AssertionError, u.run, result)
def test_unixbench_unsuccessful_sla_parallel_score(self, mock_ssh):
@@ -135,10 +135,10 @@ class UnixbenchTestCase(unittest.TestCase):
u = unixbench.Unixbench(args, self.ctx)
result = {}
- u.server = mock_ssh.SSH()
+ u.server = mock_ssh.SSH.from_node()
sample_output = '{"signle_score":"2251.7","parallel_score":"3395.9"}'
- mock_ssh.SSH().execute.return_value = (0, sample_output, '')
+ mock_ssh.SSH.from_node().execute.return_value = (0, sample_output, '')
self.assertRaises(AssertionError, u.run, result)
def test_unixbench_unsuccessful_script_error(self, mock_ssh):
@@ -158,9 +158,9 @@ class UnixbenchTestCase(unittest.TestCase):
u = unixbench.Unixbench(args, self.ctx)
result = {}
- u.server = mock_ssh.SSH()
+ u.server = mock_ssh.SSH.from_node()
- mock_ssh.SSH().execute.return_value = (1, '', 'FOOBAR')
+ mock_ssh.SSH.from_node().execute.return_value = (1, '', 'FOOBAR')
self.assertRaises(RuntimeError, u.run, result)