Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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 @@ -7,6 +7,7 @@

import io.netty.util.ThreadDeathWatcher;
import io.netty.util.concurrent.GlobalEventExecutor;

import org.elasticsearch.Version;
import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse;
import org.elasticsearch.action.admin.cluster.node.info.NodeInfo;
Expand Down Expand Up @@ -44,7 +45,6 @@
import org.elasticsearch.xpack.core.security.authc.support.UsernamePasswordToken;
import org.elasticsearch.xpack.core.security.client.SecurityClient;
import org.elasticsearch.xpack.security.LocalStateSecurity;

import org.elasticsearch.xpack.security.support.SecurityIndexManager;
import org.junit.AfterClass;
import org.junit.Before;
Expand Down Expand Up @@ -420,14 +420,18 @@ protected void createIndicesWithRandomAliases(String... indices) {
createIndex(indices);

if (frequently()) {
boolean aliasAdded = false;
IndicesAliasesRequestBuilder builder = client().admin().indices().prepareAliases();
for (String index : indices) {
if (frequently()) {
//one alias per index with prefix "alias-"
builder.addAlias(index, "alias-" + index);
aliasAdded = true;
}
}
if (randomBoolean()) {
// If we get to this point and we haven't added an alias to the request we need to add one
// or the request will fail so use noAliasAdded to force adding the alias in this case
if (aliasAdded == false || randomBoolean()) {
//one alias pointing to all indices
for (String index : indices) {
builder.addAlias(index, "alias");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ public void testEmptyAuthorizedIndicesSearchForAll() {
assertNoSearchHits(client().prepareSearch().get());
}

@AwaitsFix(bugUrl="https://github.com/elastic/elasticsearch/issues/33123")
public void testEmptyAuthorizedIndicesSearchForAllDisallowNoIndices() {
createIndicesWithRandomAliases("index1", "index2");
IndexNotFoundException e = expectThrows(IndexNotFoundException.class, () -> client().prepareSearch()
Expand Down