aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/benchmark
diff options
context:
space:
mode:
authorrexlee8776 <limingjiang@huawei.com>2018-07-24 04:17:45 +0000
committerRex Lee <limingjiang@huawei.com>2018-08-21 01:57:37 +0000
commite3eb9c69d91d4fff2cd0ccf6433fd69162973956 (patch)
tree981eb80901052055e4cae5ee19c2192cf4508061 /yardstick/benchmark
parentbd5e7473199c3ff00ce212a635453cc938387a92 (diff)
the recovery action of "baremetal down" should be triggered mandatory
YARDSTICK-1222 has made attacker recover only when the sla not pass. But for baremetal down test case, the node need to power on even the sla pass. TODO: Make attacker can support mandatory recover in some situation. JIRA: YARDSTICK-1337 Change-Id: Ib567b9b9025e5ee421ea47140c468537ad16f090 Signed-off-by: rexlee8776 <limingjiang@huawei.com> (cherry picked from commit 5f11cb9f55aa0529fddfe916a2976a9aa5b4c08f)
Diffstat (limited to 'yardstick/benchmark')
-rw-r--r--yardstick/benchmark/scenarios/availability/attacker/attacker_baremetal.py4
-rw-r--r--yardstick/benchmark/scenarios/availability/attacker/baseattacker.py1
-rwxr-xr-xyardstick/benchmark/scenarios/availability/serviceha.py6
3 files changed, 7 insertions, 4 deletions
diff --git a/yardstick/benchmark/scenarios/availability/attacker/attacker_baremetal.py b/yardstick/benchmark/scenarios/availability/attacker/attacker_baremetal.py
index 979e3ab14..77efe0dae 100644
--- a/yardstick/benchmark/scenarios/availability/attacker/attacker_baremetal.py
+++ b/yardstick/benchmark/scenarios/availability/attacker/attacker_baremetal.py
@@ -23,7 +23,7 @@ def _execute_shell_command(command, stdin=None):
output = []
try:
output = subprocess.check_output(command, stdin=stdin, shell=True)
- except Exception:
+ except Exception: # pylint: disable=broad-except
exitcode = -1
LOG.error("exec command '%s' error:\n ", command, exc_info=True)
@@ -34,6 +34,8 @@ class BaremetalAttacker(BaseAttacker):
__attacker_type__ = 'bare-metal-down'
def setup(self):
+ # baremetal down need to recover even sla pass
+ self.mandatory = True
LOG.debug("config:%s context:%s", self._config, self._context)
host = self._context.get(self._config['host'], None)
diff --git a/yardstick/benchmark/scenarios/availability/attacker/baseattacker.py b/yardstick/benchmark/scenarios/availability/attacker/baseattacker.py
index d67a16b98..7871cc918 100644
--- a/yardstick/benchmark/scenarios/availability/attacker/baseattacker.py
+++ b/yardstick/benchmark/scenarios/availability/attacker/baseattacker.py
@@ -63,6 +63,7 @@ class BaseAttacker(object):
self.data = {}
self.setup_done = False
self.intermediate_variables = {}
+ self.mandatory = False
@staticmethod
def get_attacker_cls(attacker_cfg):
diff --git a/yardstick/benchmark/scenarios/availability/serviceha.py b/yardstick/benchmark/scenarios/availability/serviceha.py
index 31caf50bd..a0e63e09d 100755
--- a/yardstick/benchmark/scenarios/availability/serviceha.py
+++ b/yardstick/benchmark/scenarios/availability/serviceha.py
@@ -87,9 +87,9 @@ class ServiceHA(base.Scenario):
def teardown(self):
"""scenario teardown"""
- # only recover when sla not pass
- if not self.sla_pass:
- for attacker in self.attackers:
+ # recover when mandatory or sla not pass
+ for attacker in self.attackers:
+ if attacker.mandatory or not self.sla_pass:
attacker.recover()