From ad3ff4cbaf92808801c9157d25416da6cff82666 Mon Sep 17 00:00:00 2001 From: Ross Brattain Date: Tue, 16 May 2017 15:39:42 -0700 Subject: 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 (cherry picked from commit 5271e612d427b29c2da84f8417f4192427ae3977) --- .../scenarios/availability/test_monitor_multi.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'tests/unit/benchmark/scenarios') 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() -- cgit 1.2.3-korg