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

Fixes test failures with security enabled #292

Merged
merged 1 commit into from
Mar 9, 2022

Conversation

downsrob
Copy link
Contributor

@downsrob downsrob commented Mar 8, 2022

Signed-off-by: Robert Downs downsrob@amazon.com

Issue #, if available:
NA

Description of changes:
Index management tests with security enabled were failing due to a mismatch in the default explain indices response between when security is enabled or disabled. When security was disabled and the index did not exist, the enabledStatus would be null. When security was enabled, the enabled status would default to false due to this code which runs during security filtering:

enabledStatus[indexNames[current]] = enabledState.getOrDefault(indexNames[current], false)

This line was added in this PR #126 over 6 months ago, so it is strange that these failures haven't surfaced before this, as the behavior should have been the same when testing with security any time since.

The following tests were failing persistently with security enabled before this change:

ISMTemplateRestAPIIT.test ism template managing index
RestExplainActionIT.test single index
RestExplainActionIT.test index pattern
RestExplainActionIT.test two indices, one managed one not managed
ManagedIndexCoordinatorIT.test managed index metadata is cleaned up after removing policy

After making this change, assembling the plugin and installing it in the previous used test cluster, the tests pass.

CheckList:

  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Robert Downs <downsrob@amazon.com>
@downsrob downsrob requested review from a team, bowenlan-amzn and dbbaughe March 8, 2022 22:35
@downsrob downsrob merged commit c9bae45 into opensearch-project:main Mar 9, 2022
@downsrob downsrob deleted the security-fix branch March 9, 2022 17:34
downsrob added a commit to downsrob/index-management that referenced this pull request Mar 9, 2022
Signed-off-by: Robert Downs <downsrob@amazon.com>
downsrob added a commit to downsrob/index-management that referenced this pull request Mar 9, 2022
Signed-off-by: Robert Downs <downsrob@amazon.com>
downsrob added a commit that referenced this pull request Mar 9, 2022
Signed-off-by: Robert Downs <downsrob@amazon.com>
wuychn pushed a commit to ochprince/index-management that referenced this pull request Mar 16, 2023
Signed-off-by: Robert Downs <downsrob@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants