diff --git a/qa/multi-cluster-search-security/src/test/resources/rest-api-spec/test/multi_cluster/50_missing.yml b/qa/multi-cluster-search-security/src/test/resources/rest-api-spec/test/multi_cluster/50_missing.yml new file mode 100644 index 00000000000..9c445f418da --- /dev/null +++ b/qa/multi-cluster-search-security/src/test/resources/rest-api-spec/test/multi_cluster/50_missing.yml @@ -0,0 +1,68 @@ +--- +setup: + - skip: + features: headers + + - do: + cluster.health: + wait_for_status: yellow + - do: + xpack.security.put_user: + username: "joe" + body: > + { + "password": "s3krit", + "roles" : [ "x_cluster_role" ] + } + - do: + xpack.security.put_role: + name: "x_cluster_role" + body: > + { + "cluster": ["all"], + "indices": [ + { + "names": ["local_index", "my_remote_cluster:test_i*", "my_remote_cluster:aliased_test_index", "test_remote_cluster:test_i*", "my_remote_cluster:secure_alias"], + "privileges": ["read"] + } + ] + } +--- +teardown: + - do: + xpack.security.delete_user: + username: "joe" + ignore: 404 + - do: + xpack.security.delete_role: + name: "x_cluster_role" + ignore: 404 +--- +"Search with missing remote index pattern": + - do: + headers: { Authorization: "Basic am9lOnMza3JpdA==" } + search: + index: "*:foo-*" + + - match: { _shards.total: 0 } + - match: { hits.total: 0 } + + - do: + headers: { Authorization: "Basic am9lOnMza3JpdA==" } + search: + index: "my_remote_cluster:foo-*" + + - match: { _shards.total: 0 } + - match: { hits.total: 0 } + + - do: + catch: "request" + headers: { Authorization: "Basic am9lOnMza3JpdA==" } + search: + index: "*:foo-bar" + + - do: + catch: "request" + headers: { Authorization: "Basic am9lOnMza3JpdA==" } + search: + index: "my_remote_cluster:foo-bar"