diff --git a/TrafficCapture/dockerSolution/src/main/docker/migrationConsole/lib/console_link/console_link/models/cluster.py b/TrafficCapture/dockerSolution/src/main/docker/migrationConsole/lib/console_link/console_link/models/cluster.py index 8b222f0cc..0a91ecaaa 100644 --- a/TrafficCapture/dockerSolution/src/main/docker/migrationConsole/lib/console_link/console_link/models/cluster.py +++ b/TrafficCapture/dockerSolution/src/main/docker/migrationConsole/lib/console_link/console_link/models/cluster.py @@ -190,10 +190,11 @@ def execute_benchmark_workload(self, workload: str, raise NotImplementedError(f"Auth type {self.auth_type} is not currently support for executing " f"benchmark workloads") # Note -- we should censor the password when logging this command - workload_revision="440ce4b1fc8832b6b7673bdcec948cce3ee87e7e" + workload_revision = "440ce4b1fc8832b6b7673bdcec948cce3ee87e7e" logger.info(f"Running opensearch-benchmark with '{workload}' workload and revision '{workload_revision}'") command = (f"opensearch-benchmark execute-test --distribution-version=1.0.0 --target-host={self.endpoint} " - f"--workload={workload} --workload-revision={workload_revision} --pipeline=benchmark-only --test-mode --kill-running-processes " + f"--workload={workload} --workload-revision={workload_revision} --pipeline=benchmark-only " + "--test-mode --kill-running-processes " f"--workload-params={workload_params} --client-options={client_options}") # While a little wordier, this apprach prevents us from censoring the password if it appears in other contexts, # e.g. username:admin,password:admin. diff --git a/TrafficCapture/dockerSolution/src/main/docker/migrationConsole/lib/console_link/tests/test_cluster.py b/TrafficCapture/dockerSolution/src/main/docker/migrationConsole/lib/console_link/tests/test_cluster.py index b87fcb9d8..197ea7662 100644 --- a/TrafficCapture/dockerSolution/src/main/docker/migrationConsole/lib/console_link/tests/test_cluster.py +++ b/TrafficCapture/dockerSolution/src/main/docker/migrationConsole/lib/console_link/tests/test_cluster.py @@ -389,8 +389,10 @@ def test_run_benchmark_executes_correctly_no_auth(mocker): mock = mocker.patch("subprocess.run", autospec=True) workload = "nyctaxis" cluster.execute_benchmark_workload(workload=workload) - mock.assert_called_once_with("opensearch-benchmark execute-test --distribution-version=1.0.0 " - f"--target-host={cluster.endpoint} --workload={workload} --pipeline=benchmark-only" + mock.assert_called_once_with("opensearch-benchmark execute-test --distribution-version=1.0.0" + f" --target-host={cluster.endpoint} --workload={workload}" + f" --workload-revision=440ce4b1fc8832b6b7673bdcec948cce3ee87e7e" + " --pipeline=benchmark-only" " --test-mode --kill-running-processes --workload-params=target_throughput:0.5," "bulk_size:10,bulk_indexing_clients:1,search_clients:1 " "--client-options=verify_certs:false", shell=True) @@ -412,7 +414,9 @@ def test_run_benchmark_executes_correctly_basic_auth_and_https(mocker): workload = "nyctaxis" cluster.execute_benchmark_workload(workload=workload) mock.assert_called_once_with("opensearch-benchmark execute-test --distribution-version=1.0.0 " - f"--target-host={cluster.endpoint} --workload={workload} --pipeline=benchmark-only" + f" --target-host={cluster.endpoint} --workload={workload}" + f" --workload-revision=440ce4b1fc8832b6b7673bdcec948cce3ee87e7e" + " --pipeline=benchmark-only" " --test-mode --kill-running-processes --workload-params=target_throughput:0.5," "bulk_size:10,bulk_indexing_clients:1,search_clients:1 " "--client-options=verify_certs:false,use_ssl:true,"