Bugfix: fix HA testcases 23/33923/1
authorJingLu5 <lvjing5@huawei.com>
Thu, 27 Apr 2017 07:49:02 +0000 (07:49 +0000)
committerJingLu5 <lvjing5@huawei.com>
Thu, 27 Apr 2017 07:49:02 +0000 (07:49 +0000)
Change-Id: Ic930c59fcf3d7e53d385016051596b6563dca0d7
Signed-off-by: JingLu5 <lvjing5@huawei.com>
yardstick/benchmark/scenarios/availability/attacker/attacker_process.py
yardstick/benchmark/scenarios/availability/monitor/monitor_command.py
yardstick/benchmark/scenarios/availability/monitor/monitor_process.py

index dc94a0b..93375a6 100644 (file)
@@ -47,7 +47,7 @@ class ProcessAttacker(BaseAttacker):
                 "/bin/sh -s {0}".format(self.service_name),
                 stdin=stdin_file)
 
-        if stdout and "running" in stdout:
+        if stdout:
             LOG.info("check the envrioment success!")
             return True
         else:
index ef07d94..033a2d7 100644 (file)
@@ -55,16 +55,7 @@ class MonitorOpenstackCmd(basemonitor.BaseMonitor):
 
     def monitor_func(self):
         exit_status = 0
-        if self.connection:
-            with open(self.check_script, "r") as stdin_file:
-                exit_status, stdout, stderr = self.connection.execute(
-                    "/bin/bash -s '{0}'".format(self.cmd),
-                    stdin=stdin_file)
-
-            LOG.debug("the ret stats: %s stdout: %s stderr: %s",
-                      exit_status, stdout, stderr)
-        else:
-            exit_status, stdout = _execute_shell_command(self.cmd)
+        exit_status, stdout = _execute_shell_command(self.cmd)
         if exit_status:
             return False
         return True
index d2020e3..ca5cac1 100644 (file)
@@ -49,6 +49,7 @@ class MonitorProcess(basemonitor.BaseMonitor):
             LOG.error("SLA failure: %f > %f", outage_time, max_outage_time)
             return False
         else:
+            LOG.info("the sla is passed")
             return True