Skip to content

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
  • Loading branch information
n1v0lg committed Dec 7, 2023
1 parent 207ca4b commit e513798
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1944,7 +1944,6 @@ private void reloadSharedSecretsForJwtRealms(Settings settingsWithKeystore) {
private void reloadRemoteClusterCredentials(Settings settingsWithKeystore) {
// Accepting a blocking call here since the underlying action is local-only and only performs fast in-memory ops
// (extracts a subset of passed in `settingsWithKeystore` and stores them in a map)
// TODO wrap exception here?
getClient().execute(
ReloadRemoteClusterCredentialsAction.INSTANCE,
new ReloadRemoteClusterCredentialsAction.Request(settingsWithKeystore)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -994,7 +994,14 @@ protected Realms getRealms() {
final var exception = expectThrows(ElasticsearchException.class, () -> security.reload(inputSettings));

assertThat(exception.getMessage(), containsString("secure settings reload failed for one or more security component"));
// TODO validate suppressed exceptions
if (failRemoteClusterCredentialsReload) {
assertThat(exception.getSuppressed()[0].getMessage(), containsString("failed remote cluster credentials reload"));
if (failRealmsReload) {
assertThat(exception.getSuppressed()[1].getMessage(), containsString("failed jwt realms reload"));
}
} else {
assertThat(exception.getSuppressed()[0].getMessage(), containsString("failed jwt realms reload"));
}
// Verify both called despite failure
verify(mockedClient).execute(eq(ReloadRemoteClusterCredentialsAction.INSTANCE), any());
verify(mockedRealms).stream();
Expand Down

0 comments on commit e513798

Please sign in to comment.