From 04eeabcd05b81cfb4689cd77018f36381c40896c Mon Sep 17 00:00:00 2001 From: Rishabh Singh Date: Fri, 22 Dec 2023 17:19:47 -0800 Subject: [PATCH] Add strong password check on cluster connection. (#4306) Signed-off-by: Rishabh Singh --- .../benchmark_test/benchmark_test_cluster.py | 11 ++++++++++- 1 file changed, 10 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..59d318c289 100644 --- a/src/test_workflow/benchmark_test/benchmark_test_cluster.py +++ b/src/test_workflow/benchmark_test/benchmark_test_cluster.py @@ -112,10 +112,19 @@ 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: + # To-do: Make this better + password = 'admin' + if self.manifest: + if semver.compare(self.manifest.build.version, '2.12.0') != -1: + password = 'myStrongPassword123!' + else: + if semver.compare(self.args.distribution_version, '2.12.0') != -1: + password = 'myStrongPassword123!' + 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)