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

[BUG] Sanity tests do not connect to the cluster with username + password #3412

Closed
peternied opened this issue Sep 26, 2023 · 2 comments
Closed
Labels
bug Something isn't working triaged Issues labeled as 'Triaged' have been reviewed and are deemed actionable.

Comments

@peternied
Copy link
Member

What is the bug?
When the plugin install tests run they use src/test/java/org/opensearch/security/sanity/tests/SingleClusterSanityIT.java to make sure the cluster is operational. However, the user the admin cert - not the username and password. This prevented detecting that the username and password logic was not correctly configured

How can one reproduce the bug?

  1. Manually execute the steps from the workflow file .github/workflows/plugin_install.yml
  2. Notable at the end there is a step:
./gradlew integTestRemote -Dtests.rest.cluster=localhost:9200 -Dtests.cluster=localhost:9200 -Dtests.clustername="opensearch" -Dhttps=true -Duser=admin -Dpassword=${{ env.CLUSTER_ADMIN_PASSWORD }} -i
  1. Change the password to any value, execute the tests, they still pass

What is the expected behavior?
The tests should fail if the password is not valid

Do you have any additional context?

@peternied peternied added bug Something isn't working untriaged Require the attention of the repository maintainers and may need to be prioritized labels Sep 26, 2023
@davidlago davidlago added triaged Issues labeled as 'Triaged' have been reviewed and are deemed actionable. and removed untriaged Require the attention of the repository maintainers and may need to be prioritized labels Oct 2, 2023
@cwperks
Copy link
Member

cwperks commented Jan 24, 2024

@peternied I believe this issue can be closed. The tests fail when I supply a wrong password. This test in particular, checks to ensure that the password configured is correct.

These sanity tests extend OpenSearchRestTestCase which configures 2 separate rest clients:

  1. client
  2. adminClient

The adminClient is configured to send REST requests with the admin certificate, but this client is not used for the sanity tests.

@cwperks
Copy link
Member

cwperks commented Jan 30, 2024

Closing this issue as it has already been resolved. See comment above.

@cwperks cwperks closed this as completed Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triaged Issues labeled as 'Triaged' have been reviewed and are deemed actionable.
Projects
None yet
Development

No branches or pull requests

3 participants