diff options
Diffstat (limited to 'yardstick/benchmark/scenarios/availability/attacker')
-rw-r--r-- | yardstick/benchmark/scenarios/availability/attacker/attacker_process.py | 5 | ||||
-rw-r--r-- | yardstick/benchmark/scenarios/availability/attacker/baseattacker.py | 4 |
2 files changed, 6 insertions, 3 deletions
diff --git a/yardstick/benchmark/scenarios/availability/attacker/attacker_process.py b/yardstick/benchmark/scenarios/availability/attacker/attacker_process.py index bff4a6dc3..e0e6cf3bf 100644 --- a/yardstick/benchmark/scenarios/availability/attacker/attacker_process.py +++ b/yardstick/benchmark/scenarios/availability/attacker/attacker_process.py @@ -38,8 +38,7 @@ class ProcessAttacker(BaseAttacker): self.recovery_script = self.get_script_fullpath( self.fault_cfg['recovery_script']) - if self.check(): - self.setup_done = True + self.data[self.service_name] = self.check() def check(self): with open(self.check_script, "r") as stdin_file: @@ -49,7 +48,7 @@ class ProcessAttacker(BaseAttacker): if stdout: LOG.info("check the envrioment success!") - return True + return int(stdout.strip('\n')) else: LOG.error( "the host envrioment is error, stdout:%s, stderr:%s", diff --git a/yardstick/benchmark/scenarios/availability/attacker/baseattacker.py b/yardstick/benchmark/scenarios/availability/attacker/baseattacker.py index ca2324055..7b3d8b0be 100644 --- a/yardstick/benchmark/scenarios/availability/attacker/baseattacker.py +++ b/yardstick/benchmark/scenarios/availability/attacker/baseattacker.py @@ -25,6 +25,7 @@ class AttackerMgr(object): def __init__(self): self._attacker_list = [] + self.data = {} def init_attackers(self, attacker_cfgs, context): LOG.debug("attackerMgr confg: %s", attacker_cfgs) @@ -35,6 +36,8 @@ class AttackerMgr(object): attacker_ins.key = cfg['key'] attacker_ins.setup() self._attacker_list.append(attacker_ins) + self.data = dict(self.data.items() + attacker_ins.data.items()) + return self.data def __getitem__(self, item): for obj in self._attacker_list: @@ -57,6 +60,7 @@ class BaseAttacker(object): self._config = config self._context = context + self.data = {} self.setup_done = False @staticmethod |