diff --git a/e2e/tools/validator/src/validator/cli/__init__.py b/e2e/tools/validator/src/validator/cli/__init__.py index 504d7fe1d9..3dd2e25271 100644 --- a/e2e/tools/validator/src/validator/cli/__init__.py +++ b/e2e/tools/validator/src/validator/cli/__init__.py @@ -434,7 +434,11 @@ def stress(cfg: config.Validator, script_path: str, report_dir: str): total_runtime_seconds = cfg.stressor.total_runtime_seconds curve_type = cfg.stressor.curve_type stress_test = remote.run_script( - script_path=script_path, total_runtime_seconds=total_runtime_seconds, curve_type=curve_type + script_path=script_path, + **{ + "t": total_runtime_seconds, + "c": curve_type, + } ) res.start_time = stress_test.start_time res.end_time = stress_test.end_time diff --git a/e2e/tools/validator/src/validator/stresser/__init__.py b/e2e/tools/validator/src/validator/stresser/__init__.py index 90ab3964ba..8115ab42e0 100644 --- a/e2e/tools/validator/src/validator/stresser/__init__.py +++ b/e2e/tools/validator/src/validator/stresser/__init__.py @@ -63,18 +63,13 @@ def copy(self, script_path, target_script): self.ssh_client.exec_command(f"chmod +x {target_script}") logger.info("copying script %s to remote - %s - successful", script_path, target_script) - def run_script( - self, script_path: str, total_runtime_seconds: int = 1200, curve_type: str = "default" - ) -> ScriptResult: + def run_script(self, script_path: str, target_script: str = "/tmp/stress.sh", **kwargs) -> ScriptResult: self.connect() - logger.info("Running script %s ...", script_path) - # ruff: noqa: S108 (Suppressed hard-coded path because we want to intentionally copy stress.sh inside `/tmp` dir) - target_script = "/tmp/stress.sh" - cli_options = f"-t {total_runtime_seconds} -c {curve_type}" + cli_options = " ".join([f"-{k} {v}" for k, v in kwargs.items()]) if kwargs else "" command = f"{target_script} {cli_options}" self.copy(script_path, target_script) - + logger.info("Running command %s ...", command) # ruff: noqa: DTZ005 (Suppressed non-time-zone aware object creation as it is not necessary for this use case) start_time = datetime.now() _, stdout, stderr = self.ssh_client.exec_command(command)