From c01eef8863d63f00fe936ed8fd10bed39d1e0a0b Mon Sep 17 00:00:00 2001 From: jaymode Date: Fri, 29 May 2015 09:16:31 -0400 Subject: [PATCH] Test: update with new core actions and upgrade api changes Original commit: elastic/x-pack-elasticsearch@0189cf850fa64b36ad63b7962f2f476d0ae0bc19 --- .../org/elasticsearch/integration/IndexPrivilegeTests.java | 6 ++---- .../java/org/elasticsearch/transport/KnownActionsTests.java | 2 ++ src/test/resources/org/elasticsearch/transport/actions | 6 ++++-- src/test/resources/org/elasticsearch/transport/handlers | 5 +++++ 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/test/java/org/elasticsearch/integration/IndexPrivilegeTests.java b/src/test/java/org/elasticsearch/integration/IndexPrivilegeTests.java index ad60eefe958..b16a894386b 100644 --- a/src/test/java/org/elasticsearch/integration/IndexPrivilegeTests.java +++ b/src/test/java/org/elasticsearch/integration/IndexPrivilegeTests.java @@ -357,8 +357,7 @@ public class IndexPrivilegeTests extends AbstractPrivilegeTests { assertAccessIsAllowed(user, "GET", "/" + index + "/_analyze", null, analyzeParams); assertAccessIsAllowed(user, "POST", "/" + index + "/_flush"); assertAccessIsAllowed(user, "POST", "/" + index + "/_optimize"); - ImmutableMap params = ImmutableMap.of("wait_for_completion", "true"); - assertAccessIsAllowed(user, "POST", "/" + index + "/_upgrade", null, params); + assertAccessIsAllowed(user, "POST", "/" + index + "/_upgrade", null); assertAccessIsAllowed(user, "POST", "/" + index + "/_close"); assertAccessIsAllowed(user, "POST", "/" + index + "/_open"); assertAccessIsAllowed(user, "POST", "/" + index + "/_cache/clear"); @@ -379,8 +378,7 @@ public class IndexPrivilegeTests extends AbstractPrivilegeTests { assertAccessIsDenied(user, "GET", "/" + index + "/_analyze", null, analyzeParams); assertAccessIsDenied(user, "POST", "/" + index + "/_flush"); assertAccessIsDenied(user, "POST", "/" + index + "/_optimize"); - ImmutableMap params = ImmutableMap.of("wait_for_completion", "true"); - assertAccessIsDenied(user, "POST", "/" + index + "/_upgrade", null, params); + assertAccessIsDenied(user, "POST", "/" + index + "/_upgrade", null); assertAccessIsDenied(user, "POST", "/" + index + "/_close"); assertAccessIsDenied(user, "POST", "/" + index + "/_open"); assertAccessIsDenied(user, "POST", "/" + index + "/_cache/clear"); diff --git a/src/test/java/org/elasticsearch/transport/KnownActionsTests.java b/src/test/java/org/elasticsearch/transport/KnownActionsTests.java index e53597dfb30..93615c582ad 100644 --- a/src/test/java/org/elasticsearch/transport/KnownActionsTests.java +++ b/src/test/java/org/elasticsearch/transport/KnownActionsTests.java @@ -13,6 +13,7 @@ import org.elasticsearch.common.io.PathUtils; import org.elasticsearch.common.io.Streams; import org.elasticsearch.common.util.Callback; import org.elasticsearch.shield.action.ShieldActionModule; +import org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope; import org.elasticsearch.test.ShieldIntegrationTest; import org.elasticsearch.license.plugin.LicensePlugin; import org.junit.BeforeClass; @@ -40,6 +41,7 @@ import static org.hamcrest.CoreMatchers.hasItems; import static org.hamcrest.Matchers.hasItem; import static org.hamcrest.Matchers.is; +@ClusterScope(numClientNodes = 0, numDataNodes = 1) public class KnownActionsTests extends ShieldIntegrationTest { private static ImmutableSet knownActions; diff --git a/src/test/resources/org/elasticsearch/transport/actions b/src/test/resources/org/elasticsearch/transport/actions index f4d25ebc85f..20f157c564e 100644 --- a/src/test/resources/org/elasticsearch/transport/actions +++ b/src/test/resources/org/elasticsearch/transport/actions @@ -33,13 +33,13 @@ indices:admin/mappings/get indices:admin/open indices:admin/optimize indices:admin/refresh -indices:admin/seal indices:admin/settings/update indices:admin/shards/search_shards indices:admin/template/delete indices:admin/template/get indices:admin/template/put indices:admin/types/exists +indices:admin/upgrade indices:admin/validate/query indices:admin/warmers/delete indices:admin/warmers/get @@ -48,6 +48,7 @@ indices:monitor/recovery indices:monitor/segments indices:monitor/settings/get indices:monitor/stats +indices:monitor/upgrade indices:data/read/count indices:data/read/exists indices:data/read/explain @@ -73,4 +74,5 @@ indices:data/write/update cluster:admin/plugin/license/get cluster:admin/plugin/license/delete cluster:admin/plugin/license/put -cluster:admin/shield/realm/cache/clear \ No newline at end of file +cluster:admin/shield/realm/cache/clear +internal:indices/admin/upgrade \ No newline at end of file diff --git a/src/test/resources/org/elasticsearch/transport/handlers b/src/test/resources/org/elasticsearch/transport/handlers index 822976dabef..d51dc76536f 100644 --- a/src/test/resources/org/elasticsearch/transport/handlers +++ b/src/test/resources/org/elasticsearch/transport/handlers @@ -14,6 +14,8 @@ indices:admin/mappings/fields/get[index] indices:admin/mappings/fields/get[index][s] indices:admin/optimize[s] indices:admin/refresh[s] +indices:admin/upgrade +indices:admin/upgrade[s] indices:admin/validate/query[s] indices:data/read/exists[s] indices:data/read/explain[s] @@ -46,6 +48,8 @@ indices:data/write/index[r] indices:monitor/recovery[s] indices:monitor/segments[s] indices:monitor/stats[s] +indices:monitor/upgrade[s] +indices:monitor/upgrade internal:cluster/node/index/deleted internal:cluster/node/index_store/deleted internal:cluster/node/mapping/refresh @@ -78,6 +82,7 @@ internal:index/shard/recovery/start_recovery internal:index/shard/recovery/translog_ops internal:index/termvectors/dfs internal:index/termvectors/dfs[s] +internal:indices/admin/upgrade internal:indices/flush/synced/in_flight internal:indices/flush/synced/pre internal:indices/flush/synced/sync