From aee8f4fe34efe837e2e1cb0b06ee3794fb159c12 Mon Sep 17 00:00:00 2001 From: Rishabh Singh Date: Fri, 22 Dec 2023 16:20:09 -0800 Subject: [PATCH] Add strong password check on cluster connection Signed-off-by: Rishabh Singh --- src/test_workflow/benchmark_test/benchmark_test_cluster.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/test_workflow/benchmark_test/benchmark_test_cluster.py b/src/test_workflow/benchmark_test/benchmark_test_cluster.py index be8d68e927..f90c3edc36 100644 --- a/src/test_workflow/benchmark_test/benchmark_test_cluster.py +++ b/src/test_workflow/benchmark_test/benchmark_test_cluster.py @@ -112,10 +112,11 @@ def terminate(self) -> None: subprocess.check_call(command, cwd=os.getcwd(), shell=True) def wait_for_processing(self, tries: int = 3, delay: int = 15, backoff: int = 2) -> None: + password = 'myStrongPassword123!' if semver.compare(self.distribution_version, '2.12.0') != -1 else 'admin' logging.info(f"Waiting for domain at {self.endpoint} to be up") protocol = "http://" if self.args.insecure else "https://" url = "".join([protocol, self.endpoint, "/_cluster/health"]) - request_args = {"url": url} if self.args.insecure else {"url": url, "auth": HTTPBasicAuth("admin", "admin"), # type: ignore + request_args = {"url": url} if self.args.insecure else {"url": url, "auth": HTTPBasicAuth("admin", password), # type: ignore "verify": False} # type: ignore retry_call(requests.get, fkwargs=request_args, tries=tries, delay=delay, backoff=backoff)