diff options
author | Jing Lu <lvjing5@huawei.com> | 2017-05-04 12:59:04 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2017-05-04 12:59:04 +0000 |
commit | 20f5b0a8580c0e8c659424bab434a0e30f3c88c1 (patch) | |
tree | f683654bf3247b4d5c8903ed01eb6415105e9248 /tests/unit/benchmark/scenarios/networking/test_netutilization.py | |
parent | 058f0a93fd37694b74c5f1414bdfa6b35114690a (diff) | |
parent | 150481286dcf3c3c1fedd8213070cff48e5ad61d (diff) |
Merge "standardize ssh auth" into stable/danube
Diffstat (limited to 'tests/unit/benchmark/scenarios/networking/test_netutilization.py')
-rw-r--r-- | tests/unit/benchmark/scenarios/networking/test_netutilization.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/unit/benchmark/scenarios/networking/test_netutilization.py b/tests/unit/benchmark/scenarios/networking/test_netutilization.py index 7c04f5e9a..1227e056e 100644 --- a/tests/unit/benchmark/scenarios/networking/test_netutilization.py +++ b/tests/unit/benchmark/scenarios/networking/test_netutilization.py @@ -42,7 +42,7 @@ class NetUtilizationTestCase(unittest.TestCase): args = {'options': options} n = netutilization.NetUtilization(args, self.ctx) - mock_ssh.SSH().execute.return_value = (0, '', '') + mock_ssh.SSH.from_node().execute.return_value = (0, '', '') n.setup() self.assertIsNotNone(n.client) @@ -56,11 +56,11 @@ class NetUtilizationTestCase(unittest.TestCase): args = {'options': options} n = netutilization.NetUtilization(args, self.ctx) - mock_ssh.SSH().execute.return_value = (0, '', '') + mock_ssh.SSH.from_node().execute.return_value = (0, '', '') n.setup() expected_result = 'abcdefg' - mock_ssh.SSH().execute.return_value = (0, expected_result, '') + mock_ssh.SSH.from_node().execute.return_value = (0, expected_result, '') result = n._execute_command("foo") self.assertEqual(result, expected_result) @@ -72,10 +72,10 @@ class NetUtilizationTestCase(unittest.TestCase): args = {'options': options} n = netutilization.NetUtilization(args, self.ctx) - mock_ssh.SSH().execute.return_value = (0, '', '') + mock_ssh.SSH.from_node().execute.return_value = (0, '', '') n.setup() - mock_ssh.SSH().execute.return_value = (127, '', 'abcdefg') + mock_ssh.SSH.from_node().execute.return_value = (127, '', 'abcdefg') self.assertRaises(RuntimeError, n._execute_command, "failed") @@ -87,11 +87,11 @@ class NetUtilizationTestCase(unittest.TestCase): args = {'options': options} n = netutilization.NetUtilization(args, self.ctx) - mock_ssh.SSH().execute.return_value = (0, '', '') + mock_ssh.SSH.from_node().execute.return_value = (0, '', '') n.setup() mpstat_output = self._read_file("netutilization_sample_output1.txt") - mock_ssh.SSH().execute.return_value = (0, mpstat_output, '') + mock_ssh.SSH.from_node().execute.return_value = (0, mpstat_output, '') result = n._get_network_utilization() expected_result = \ @@ -157,11 +157,11 @@ class NetUtilizationTestCase(unittest.TestCase): args = {'options': options} n = netutilization.NetUtilization(args, self.ctx) - mock_ssh.SSH().execute.return_value = (0, '', '') + mock_ssh.SSH.from_node().execute.return_value = (0, '', '') n.setup() mpstat_output = self._read_file("netutilization_sample_output2.txt") - mock_ssh.SSH().execute.return_value = (0, mpstat_output, '') + mock_ssh.SSH.from_node().execute.return_value = (0, mpstat_output, '') result = n._get_network_utilization() expected_result = \ |