Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass in strong password to OSD integ test if version >= 2.12.0 #4334

Merged
merged 25 commits into from
Jan 10, 2024
Merged
Changes from 18 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def __init__(
super().__init__(work_dir, version, distribution, security_enabled, additional_config, dependency_installer)
self.dist = Distributions.get_distribution("opensearch-dashboards", distribution, version, work_dir)
self.install_dir = self.dist.install_dir
self.password = 'myStrongPassword123!' if float('.'.join(self.version.split('.')[:2])) >= 2.12 else 'admin'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR should address this failure: https://build.ci.opensearch.org/blue/organizations/jenkins/integ-test-opensearch-dashboards/detail/integ-test-opensearch-dashboards/5025/pipeline, however I am not sure how the OS binary is pulled - is it given myStrongPassword123! as the password somehow?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @derek-ho , can you try semver package instead of float check? See #4304

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gaiksaya done. Question still stands though, I am confused about the overall setup of: https://build.ci.opensearch.org/blue/organizations/jenkins/integ-test-opensearch-dashboards/detail/integ-test-opensearch-dashboards/5025/pipeline/, would this change be sufficient to pass the integ test? Would the backend be spun up with the strong password as expected if version >= 2.12.0?

Copy link
Member

@gaiksaya gaiksaya Jan 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The integration test set up can be found here: https://github.com/opensearch-project/opensearch-build/blob/main/src/test_workflow/integ_test/ for both OS and OSD.
Maybe try to parse this directory to check for anything admin:admin?
If it feels there is a lot of if/else going on each module, maybe extract the logic into a common library (utils?) (something like get_password(version)) that can be used universally. Example being this system module.

WDYT @prudhvigodithi ?


def start(self) -> None:
self.dist.install(self.download())
Expand Down Expand Up @@ -86,7 +87,7 @@ def url(self, path: str = "") -> str:
def get_service_response(self) -> Response:
url = self.url("/api/status")
logging.info(f"Pinging {url}")
return requests.get(url, verify=False, auth=("admin", "admin") if self.security_enabled else None)
return requests.get(url, verify=False, auth=("admin", self.password) if self.security_enabled else None)

def __add_plugin_specific_config(self, additional_config: dict) -> None:
with open(self.opensearch_dashboards_yml_path, "a") as yamlfile:
Expand Down
Loading