Пример #1
0
    def test__monitor_general_failure(self, mock_open, mock_ssh):
        ins = monitor_general.GeneralMonitor(self.monitor_cfg_noparam, self.context)

        ins.setup()
        mock_ssh.SSH().execute.return_value = (1, "error", 'error')
        ins.monitor_func()
        ins._result = {'outage_time' : 2}
        ins.verify_SLA()
Пример #2
0
    def test__monitor_general_all_successful_noparam(self, mock_open, mock_ssh):
        ins = monitor_general.GeneralMonitor(self.monitor_cfg_noparam, self.context)

        ins.setup()
        mock_ssh.SSH().execute.return_value = (0, "running", '')
        ins.monitor_func()
        ins._result = {'outage_time' : 0}
        ins.verify_SLA()
Пример #3
0
    def test__monitor_general_all_successful(self, mock_open, mock_ssh):
        ins = monitor_general.GeneralMonitor(self.monitor_cfg, self.context,
                                             {"nova-api": 10})

        ins.setup()
        mock_ssh.SSH.from_node().execute.return_value = (0, "running", '')
        ins.monitor_func()
        ins._result = {'outage_time': 0}
        ins.verify_SLA()