diff options
author | Ross Brattain <ross.b.brattain@intel.com> | 2017-05-16 15:39:42 -0700 |
---|---|---|
committer | Ross Brattain <ross.b.brattain@intel.com> | 2017-05-16 15:43:56 -0700 |
commit | 5271e612d427b29c2da84f8417f4192427ae3977 (patch) | |
tree | b6d1f3d9135c6965eea4401cf4079d3e452d7537 /tests/unit/benchmark | |
parent | a5e13df9381c531716b1e41e7a9dedb130fc6e35 (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>
Diffstat (limited to 'tests/unit/benchmark')
-rw-r--r-- | tests/unit/benchmark/scenarios/availability/test_monitor_multi.py | 16 |
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() |