- time.sleep(self.monitor_ins.monitor_time)
-
- self.monitor_ins.stop()
- LOG.info("monitor stop!")
-
- ret = self.monitor_ins.get_result()
- LOG.info("The monitor result:%s" % ret)
- outage_time = ret.get("outage_time")
- result["outage_time"] = outage_time
- LOG.info("the result:%s" % result)
-
- if "sla" in self.scenario_cfg:
- sla_outage_time = int(self.scenario_cfg["sla"]["outage_time"])
- assert outage_time <= sla_outage_time, "outage_time %f > sla:outage_time(%f)" % \
- (outage_time, sla_outage_time)
+ self.monitorMgr.wait_monitors()
+ LOG.info("HA monitor stop!")
+
+ sla_pass = self.monitorMgr.verify_SLA()
+ for k, v in self.data.items():
+ if v == 0:
+ result['sla_pass'] = 0
+ LOG.info("The service process not found in the host envrioment, \
+the HA test case NOT pass")
+ return
+ if sla_pass:
+ result['sla_pass'] = 1
+ LOG.info("The HA test case PASS the SLA")
+ else:
+ result['sla_pass'] = 0
+ assert sla_pass is True, "The HA test case NOT pass the SLA"