diff options
author | qiujuan <juan_qiu@tongji.edu.cn> | 2017-09-03 12:31:13 +0800 |
---|---|---|
committer | qiujuan <juan_qiu@tongji.edu.cn> | 2017-10-04 15:46:29 +0800 |
commit | 4db989878666a57a65ca23715ece0c93a078ce85 (patch) | |
tree | 19913df39de4beddb52f952e2d0c01d8dfc817fa /yardstick/benchmark/scenarios/availability/result_checker | |
parent | add9dfa6f8739ec3328388c2658750e185e6a3ed (diff) |
Add intermediate variables for attacker,monitor,result_checker
JIRA: YARDSTICK-790
Change-Id: I6bb36c98b8673155d3142fc54cfb39315d5ce613
Signed-off-by: qiujuan <juan_qiu@tongji.edu.cn>
Diffstat (limited to 'yardstick/benchmark/scenarios/availability/result_checker')
-rw-r--r-- | yardstick/benchmark/scenarios/availability/result_checker/baseresultchecker.py | 1 | ||||
-rw-r--r-- | yardstick/benchmark/scenarios/availability/result_checker/result_checker_general.py | 18 |
2 files changed, 9 insertions, 10 deletions
diff --git a/yardstick/benchmark/scenarios/availability/result_checker/baseresultchecker.py b/yardstick/benchmark/scenarios/availability/result_checker/baseresultchecker.py index 05b660105..d1750ab65 100644 --- a/yardstick/benchmark/scenarios/availability/result_checker/baseresultchecker.py +++ b/yardstick/benchmark/scenarios/availability/result_checker/baseresultchecker.py @@ -66,6 +66,7 @@ class BaseResultChecker(object): self._config = config self._context = context self.setup_done = False + self.intermediate_variables = {} @staticmethod def get_resultchecker_cls(type): diff --git a/yardstick/benchmark/scenarios/availability/result_checker/result_checker_general.py b/yardstick/benchmark/scenarios/availability/result_checker/result_checker_general.py index 454338175..0802aa452 100644 --- a/yardstick/benchmark/scenarios/availability/result_checker/result_checker_general.py +++ b/yardstick/benchmark/scenarios/availability/result_checker/result_checker_general.py @@ -15,7 +15,7 @@ from yardstick.benchmark.scenarios.availability.result_checker \ from yardstick.benchmark.scenarios.availability import Condition import yardstick.ssh as ssh from yardstick.benchmark.scenarios.availability.util \ - import buildshellparams, execute_shell_command + import execute_shell_command, build_shell_command LOG = logging.getLogger(__name__) @@ -40,22 +40,20 @@ class GeneralResultChecker(BaseResultChecker): self.condition = self._config['condition'] self.expectedResult = self._config['expectedValue'] self.actualResult = object() - self.key = self._config['key'] if "parameter" in self._config: - parameter = self._config['parameter'] - str = buildshellparams( - parameter, True if self.connection else False) - l = list(item for item in parameter.values()) - self.shell_cmd = str.format(*l) - - self.resultchecker_cfgs = BaseResultChecker.resultchecker_cfgs.get( - self.resultchecker_key) + self.parameter_config = self._config['parameter'] + self.resultchecker_cfgs = BaseResultChecker.resultchecker_cfgs.get(self.resultchecker_key) self.verify_script = self.get_script_fullpath( self.resultchecker_cfgs['verify_script']) def verify(self): if "parameter" in self._config: + self.shell_cmd = \ + build_shell_command( + self.parameter_config, + bool(self.connection), + self.intermediate_variables) if self.connection: with open(self.verify_script, "r") as stdin_file: exit_status, stdout, stderr = self.connection.execute( |