From 2fc67a3bf24d32c6188a3cf9e88a834f1597d7b1 Mon Sep 17 00:00:00 2001 From: Thomas Callahan Date: Thu, 17 May 2018 13:02:49 -0400 Subject: [PATCH] Harmonize include_defaults tests This PR breaks the include_defaults functionality of the get settings API into its own test, which is skipped for mixed-mode clusters containing pre-6.4 nodes. --- .../test/indices.get_settings/30_defaults.yml | 28 +++++++++++++++++++ .../test/indices.put_settings/11_reset.yml | 12 -------- 2 files changed, 28 insertions(+), 12 deletions(-) create mode 100644 rest-api-spec/src/main/resources/rest-api-spec/test/indices.get_settings/30_defaults.yml diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.get_settings/30_defaults.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.get_settings/30_defaults.yml new file mode 100644 index 0000000000000..2e3f4af03ebef --- /dev/null +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.get_settings/30_defaults.yml @@ -0,0 +1,28 @@ +--- +setup: + - do: + indices.create: + body: + settings: + index: + number_of_shards: 1 + number_of_replicas: 1 + index: test-index +--- +Test retrieval of default settings: + - skip: + version: " - 6.3.99" + reason: include_defaults will not work in mixed-mode clusters containing nodes pre-6.4 + - do: + indices.get_settings: + flat_settings: true + index: test-index + - is_false: + test-index.settings.index\.refresh_interval + - do: + indices.get_settings: + include_defaults: true + flat_settings: true + index: test-index + - match: + test-index.defaults.index\.refresh_interval: "1s" diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.put_settings/11_reset.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.put_settings/11_reset.yml index d7bd87cc73a82..ac5564fcd3ec4 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.put_settings/11_reset.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.put_settings/11_reset.yml @@ -23,15 +23,3 @@ Test reset index settings: indices.get_settings: flat_settings: false - is_false: test-index.settings.index\.refresh_interval - -# Disabled until https://github.com/elastic/elasticsearch/pull/29229 is back-ported -# That PR changed the execution path of index settings default to be on the master -# until the PR is back-ported the old master will not return default settings. -# -# - do: -# indices.get_settings: -# include_defaults: true -# flat_settings: true -# index: test-index -# - match: -# test-index.defaults.index\.refresh_interval: "1s"