Skip to content

Commit

Permalink
Add strong password check on cluster connection. (opensearch-project#…
Browse files Browse the repository at this point in the history
…4306)

Signed-off-by: Rishabh Singh <[email protected]>
  • Loading branch information
rishabh6788 authored Dec 23, 2023
1 parent 0eeb08e commit 04eeabc
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/test_workflow/benchmark_test/benchmark_test_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 04eeabc

Please sign in to comment.