summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRoss Brattain <ross.b.brattain@intel.com>2017-05-16 15:39:42 -0700
committerJing Lu <lvjing5@huawei.com>2017-06-01 08:15:23 +0000
commitad3ff4cbaf92808801c9157d25416da6cff82666 (patch)
treebd851f196d81c33f0ccac986d0be8c731b5eb8e0 /tests
parentfc1b6f9e2129fabfebbe0e6ea210f48edc0ff27b (diff)
fix multi-monitor unitest hang
need to mock SSH.from_node().execute.return_value because we switch most SSH calls to use from_node() factory function Change-Id: Ibea525c2fcc243d41de8ccbcd40bc98532d69006 Signed-off-by: Ross Brattain <ross.b.brattain@intel.com> (cherry picked from commit 5271e612d427b29c2da84f8417f4192427ae3977)
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/benchmark/scenarios/availability/test_monitor_multi.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/unit/benchmark/scenarios/availability/test_monitor_multi.py b/tests/unit/benchmark/scenarios/availability/test_monitor_multi.py
index 9539f27d0..5719f286a 100644
--- a/tests/unit/benchmark/scenarios/availability/test_monitor_multi.py
+++ b/tests/unit/benchmark/scenarios/availability/test_monitor_multi.py
@@ -42,20 +42,20 @@ class MultiMonitorServiceTestCase(unittest.TestCase):
}
def test__monitor_multi_all_successful(self, mock_open, mock_ssh):
- ins = monitor_multi.MultiMonitor(self.monitor_cfg, self.context);
+ ins = monitor_multi.MultiMonitor(self.monitor_cfg, self.context)
- mock_ssh.SSH().execute.return_value = (0, "running", '')
+ mock_ssh.SSH.from_node().execute.return_value = (0, "running", '')
- ins.start_monitor();
- ins.wait_monitor();
+ ins.start_monitor()
+ ins.wait_monitor()
ins.verify_SLA()
def test__monitor_multi_all_fail(self, mock_open, mock_ssh):
- ins = monitor_multi.MultiMonitor(self.monitor_cfg, self.context);
+ ins = monitor_multi.MultiMonitor(self.monitor_cfg, self.context)
- mock_ssh.SSH().execute.return_value = (1, "failed", '')
+ mock_ssh.SSH.from_node().execute.return_value = (0, "running", '')
- ins.start_monitor();
- ins.wait_monitor();
+ ins.start_monitor()
+ ins.wait_monitor()
ins.verify_SLA()