X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=yardstick%2Fbenchmark%2Fscenarios%2Favailability%2Fattacker%2Fattacker_general.py;h=5e7716e4995e8af0f63b5b9d6120dbca7bd841d0;hb=eb527820ddb21081399b27deaacc8a651ea5f06a;hp=018362a152464b4622cfa801d5e144367cb0a44f;hpb=14c7413448e4690fefd0ecad908ec86d6f774d6f;p=yardstick.git diff --git a/yardstick/benchmark/scenarios/availability/attacker/attacker_general.py b/yardstick/benchmark/scenarios/availability/attacker/attacker_general.py index 018362a15..5e7716e49 100644 --- a/yardstick/benchmark/scenarios/availability/attacker/attacker_general.py +++ b/yardstick/benchmark/scenarios/availability/attacker/attacker_general.py @@ -24,13 +24,16 @@ class GeneralAttacker(BaseAttacker): host = self._context.get(self._config['host'], None) ip = host.get("ip", None) user = host.get("user", "root") + ssh_port = host.get("ssh_port", ssh.DEFAULT_PORT) key_filename = host.get("key_filename", "~/.ssh/id_rsa") - self.connection = ssh.SSH(user, ip, key_filename=key_filename) + self.connection = ssh.SSH(user, ip, key_filename=key_filename, + port=ssh_port) self.connection.wait(timeout=600) LOG.debug("ssh host success!") self.key = self._config['key'] + self.attack_key = self._config['attack_key'] if "action_parameter" in self._config: actionParameter = self._config['action_parameter'] @@ -50,7 +53,7 @@ class GeneralAttacker(BaseAttacker): l = list(item for item in rollbackParameter.values()) self.rollback_param = str.format(*l) - self.fault_cfg = BaseAttacker.attacker_cfgs.get(self.key) + self.fault_cfg = BaseAttacker.attacker_cfgs.get(self.attack_key) self.inject_script = self.get_script_fullpath( self.fault_cfg['inject_script']) self.recovery_script = self.get_script_fullpath(