aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/benchmark/scenarios/compute/test_cachestat.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_cachestat.py
parent058f0a93fd37694b74c5f1414bdfa6b35114690a (diff)
parent150481286dcf3c3c1fedd8213070cff48e5ad61d (diff)
Merge "standardize ssh auth" into stable/danube
Diffstat (limited to 'tests/unit/benchmark/scenarios/compute/test_cachestat.py')
-rw-r--r--tests/unit/benchmark/scenarios/compute/test_cachestat.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/unit/benchmark/scenarios/compute/test_cachestat.py b/tests/unit/benchmark/scenarios/compute/test_cachestat.py
index 8a06c754b..b0ddfc6b4 100644
--- a/tests/unit/benchmark/scenarios/compute/test_cachestat.py
+++ b/tests/unit/benchmark/scenarios/compute/test_cachestat.py
@@ -35,7 +35,7 @@ class CACHEstatTestCase(unittest.TestCase):
def test_cachestat_successful_setup(self, mock_ssh):
c = cachestat.CACHEstat({}, self.ctx)
- mock_ssh.SSH().execute.return_value = (0, '', '')
+ mock_ssh.SSH.from_node().execute.return_value = (0, '', '')
c.setup()
self.assertIsNotNone(c.client)
@@ -43,20 +43,20 @@ class CACHEstatTestCase(unittest.TestCase):
def test_execute_command_success(self, mock_ssh):
c = cachestat.CACHEstat({}, self.ctx)
- mock_ssh.SSH().execute.return_value = (0, '', '')
+ mock_ssh.SSH.from_node().execute.return_value = (0, '', '')
c.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 = c._execute_command("foo")
self.assertEqual(result, expected_result)
def test_execute_command_failed(self, mock_ssh):
c = cachestat.CACHEstat({}, self.ctx)
- mock_ssh.SSH().execute.return_value = (0, '', '')
+ mock_ssh.SSH.from_node().execute.return_value = (0, '', '')
c.setup()
- mock_ssh.SSH().execute.return_value = (127, '', 'Failed executing \
+ mock_ssh.SSH.from_node().execute.return_value = (127, '', 'Failed executing \
command')
self.assertRaises(RuntimeError, c._execute_command,
"cat /proc/meminfo")
@@ -67,11 +67,11 @@ class CACHEstatTestCase(unittest.TestCase):
}
args = {"options": options}
c = cachestat.CACHEstat(args, self.ctx)
- mock_ssh.SSH().execute.return_value = (0, '', '')
+ mock_ssh.SSH.from_node().execute.return_value = (0, '', '')
c.setup()
output = self._read_file("cachestat_sample_output.txt")
- mock_ssh.SSH().execute.return_value = (0, output, '')
+ mock_ssh.SSH.from_node().execute.return_value = (0, output, '')
result = c._get_cache_usage()
expected_result = {"cachestat": {"cache0": {"HITS": "6462",
"DIRTIES": "29",