- for fault in service_cfg:
- if fault["type"] == self.fault_type:
- self.fault_cfg = fault
- break
- if not self.fault_cfg:
- LOG.error(
- "The fualt_type %s can not be supproted!" % self.fault_type)
- return
- LOG.debug("the fault_cfg :%s" % self.fault_cfg)
-
- self.fault_script = pkg_resources.resource_filename(
- "yardstick.benchmark.scenarios.availability",
- self.fault_cfg["inject_script"])
- self.recovery_script = pkg_resources.resource_filename(
- "yardstick.benchmark.scenarios.availability",
- self.fault_cfg["recovery_script"])
- self.check_script = pkg_resources.resource_filename(
- "yardstick.benchmark.scenarios.availability",
- self.fault_cfg["check_script"])
-
- host = self.context_cfg.get("host", None)
- ip = host.get("ip", None)
- user = host.get("user", "root")
- key_filename = host.get("key_filename", "~/.ssh/id_rsa")
- LOG.info("The host: %s the service: %s" % (ip, self.service_name))
- LOG.debug("The params, host:%s fault_cfg:%s" % (host, self.fault_cfg))
+ self.attackers = []
+ attacker_cfgs = self.scenario_cfg["options"]["attackers"]
+ for attacker_cfg in attacker_cfgs:
+ attacker_cls = baseattacker.BaseAttacker.get_attacker_cls(
+ attacker_cfg)
+ attacker_ins = attacker_cls(attacker_cfg, nodes)
+ attacker_ins.setup()
+ self.attackers.append(attacker_ins)