summaryrefslogtreecommitdiffstats
path: root/yardstick/benchmark
diff options
context:
space:
mode:
Diffstat (limited to 'yardstick/benchmark')
-rwxr-xr-xyardstick/benchmark/scenarios/availability/serviceha.py19
-rw-r--r--yardstick/benchmark/scenarios/networking/pktgen_dpdk.py5
2 files changed, 12 insertions, 12 deletions
diff --git a/yardstick/benchmark/scenarios/availability/serviceha.py b/yardstick/benchmark/scenarios/availability/serviceha.py
index 76721e38c..7f976fdbc 100755
--- a/yardstick/benchmark/scenarios/availability/serviceha.py
+++ b/yardstick/benchmark/scenarios/availability/serviceha.py
@@ -29,6 +29,7 @@ class ServiceHA(base.Scenario):
self.context_cfg = context_cfg
self.setup_done = False
self.data = {}
+ self.sla_pass = False
def setup(self):
"""scenario setup"""
@@ -69,26 +70,28 @@ class ServiceHA(base.Scenario):
self.monitorMgr.wait_monitors()
LOG.info("Monitor '%s' stop!", self.__scenario_type__)
- sla_pass = self.monitorMgr.verify_SLA()
+ self.sla_pass = self.monitorMgr.verify_SLA()
service_not_found = False
for k, v in self.data.items():
if v == 0:
- sla_pass = False
+ self.sla_pass = False
service_not_found = True
LOG.info("The service process (%s) not found in the host envrioment", k)
- result['sla_pass'] = 1 if sla_pass else 0
+ result['sla_pass'] = 1 if self.sla_pass else 0
self.monitorMgr.store_result(result)
self.verify_SLA(
- sla_pass, ("a service process was not found in the host "
- "environment" if service_not_found
- else "MonitorMgr.verify_SLA() failed"))
+ self.sla_pass, ("a service process was not found in the host "
+ "environment" if service_not_found
+ else "MonitorMgr.verify_SLA() failed"))
def teardown(self):
"""scenario teardown"""
- for attacker in self.attackers:
- attacker.recover()
+ # only recover when sla not pass
+ if not self.sla_pass:
+ for attacker in self.attackers:
+ attacker.recover()
def _test(): # pragma: no cover
diff --git a/yardstick/benchmark/scenarios/networking/pktgen_dpdk.py b/yardstick/benchmark/scenarios/networking/pktgen_dpdk.py
index 1b018f52a..efb7d8b5d 100644
--- a/yardstick/benchmark/scenarios/networking/pktgen_dpdk.py
+++ b/yardstick/benchmark/scenarios/networking/pktgen_dpdk.py
@@ -113,10 +113,7 @@ cat ~/result.log -vT \
{print substr($0,RSTART,RLENGTH)}' \
|grep -v ^$ |awk '{if ($2 != 0) print $2}'\
"""
- client_status, client_stdout, client_stderr = self.client.execute(cmd)
-
- if client_status:
- raise RuntimeError(client_stderr)
+ _, client_stdout, _ = self.client.execute(cmd, raise_on_error=True)
avg_latency = 0
if client_stdout: