From 955c6dd8a9f3e9602d69721fdc1ace1f1e3810ae Mon Sep 17 00:00:00 2001 From: Tal Levy Date: Fri, 26 Oct 2018 15:40:26 -0700 Subject: [PATCH 1/2] add ILM rolling upgrade tests (#32828) --- .../test/mixed_cluster/70_ilm.yml | 31 ++++++++++++ .../rest-api-spec/test/old_cluster/70_ilm.yml | 49 +++++++++++++++++++ .../test/upgraded_cluster/70_ilm.yml | 21 ++++++++ 3 files changed, 101 insertions(+) create mode 100644 x-pack/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/mixed_cluster/70_ilm.yml create mode 100644 x-pack/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/old_cluster/70_ilm.yml create mode 100644 x-pack/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/upgraded_cluster/70_ilm.yml diff --git a/x-pack/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/mixed_cluster/70_ilm.yml b/x-pack/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/mixed_cluster/70_ilm.yml new file mode 100644 index 0000000000000..d444d5fefeee0 --- /dev/null +++ b/x-pack/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/mixed_cluster/70_ilm.yml @@ -0,0 +1,31 @@ +--- +"Test Set Policy On Index": + - do: + ilm.get_lifecycle: + policy: "my_lifecycle" + - match: { my_lifecycle.policy.phases.warm.minimum_age: "1000d" } + + - do: + ilm.explain_lifecycle: + index: "my_old_index" + - is_true: indices.my_old_index.managed + - match: { indices.my_old_index.index: "my_old_index" } + - match: { indices.my_old_index.policy: "my_lifecycle" } + + - do: + indices.create: + index: my_mixed_index + body: + settings: + index.lifecycle.name: "my_lifecycle" + + - do: + ilm.explain_lifecycle: + index: "my_mixed_index" + - is_true: indices.my_mixed_index.managed + - match: { indices.my_mixed_index.index: "my_mixed_index" } + - match: { indices.my_mixed_index.policy: "my_lifecycle" } + + - do: + indices.delete: + index: my_mixed_index diff --git a/x-pack/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/old_cluster/70_ilm.yml b/x-pack/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/old_cluster/70_ilm.yml new file mode 100644 index 0000000000000..d2c92de684a06 --- /dev/null +++ b/x-pack/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/old_cluster/70_ilm.yml @@ -0,0 +1,49 @@ +--- +"Test Basic Policy Creation": + - do: + catch: missing + ilm.get_lifecycle: + policy: "my_lifecycle" + + - do: + catch: missing + ilm.delete_lifecycle: + policy: "my_lifecycle" + + - do: + ilm.put_lifecycle: + policy: "my_lifecycle" + body: | + { + "policy": { + "phases": { + "warm": { + "minimum_age": "1000d", + "actions": { + "forcemerge": { + "max_num_segments": 10000 + } + } + } + } + } + } + + - do: + ilm.get_lifecycle: + policy: "my_lifecycle" + - match: { my_lifecycle.policy.phases.warm.minimum_age: "1000d" } + + - do: + indices.create: + index: my_old_index + body: + settings: + index.lifecycle.name: "my_lifecycle" + + - do: + ilm.explain_lifecycle: + index: "my_old_index" + - is_true: indices.my_old_index.managed + - match: { indices.my_old_index.index: "my_old_index" } + - match: { indices.my_old_index.policy: "my_lifecycle" } diff --git a/x-pack/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/upgraded_cluster/70_ilm.yml b/x-pack/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/upgraded_cluster/70_ilm.yml new file mode 100644 index 0000000000000..f548d6a804786 --- /dev/null +++ b/x-pack/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/upgraded_cluster/70_ilm.yml @@ -0,0 +1,21 @@ +--- +"Test Lifecycle Still There And Indices Are Still Managed": + - do: + ilm.get_lifecycle: + policy: "my_lifecycle" + - match: { my_lifecycle.policy.phases.warm.minimum_age: "1000d" } + + - do: + ilm.explain_lifecycle: + index: "my_old_index" + - is_true: indices.my_old_index.managed + - match: { indices.my_old_index.index: "my_old_index" } + - match: { indices.my_old_index.policy: "my_lifecycle" } + + - do: + indices.delete: + index: my_old_index + + - do: + ilm.delete_lifecycle: + policy: "my_lifecycle" From 299becd576e2f02894797bda0dafa46e5f82c358 Mon Sep 17 00:00:00 2001 From: Tal Levy Date: Tue, 6 Nov 2018 20:32:14 -0800 Subject: [PATCH 2/2] update min_age change in latest --- .../resources/rest-api-spec/test/mixed_cluster/70_ilm.yml | 2 +- .../test/resources/rest-api-spec/test/old_cluster/70_ilm.yml | 4 ++-- .../resources/rest-api-spec/test/upgraded_cluster/70_ilm.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/x-pack/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/mixed_cluster/70_ilm.yml b/x-pack/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/mixed_cluster/70_ilm.yml index d444d5fefeee0..97523d235d94a 100644 --- a/x-pack/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/mixed_cluster/70_ilm.yml +++ b/x-pack/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/mixed_cluster/70_ilm.yml @@ -3,7 +3,7 @@ - do: ilm.get_lifecycle: policy: "my_lifecycle" - - match: { my_lifecycle.policy.phases.warm.minimum_age: "1000d" } + - match: { my_lifecycle.policy.phases.warm.min_age: "1000d" } - do: ilm.explain_lifecycle: diff --git a/x-pack/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/old_cluster/70_ilm.yml b/x-pack/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/old_cluster/70_ilm.yml index d2c92de684a06..48b8375c23314 100644 --- a/x-pack/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/old_cluster/70_ilm.yml +++ b/x-pack/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/old_cluster/70_ilm.yml @@ -18,7 +18,7 @@ "policy": { "phases": { "warm": { - "minimum_age": "1000d", + "min_age": "1000d", "actions": { "forcemerge": { "max_num_segments": 10000 @@ -32,7 +32,7 @@ - do: ilm.get_lifecycle: policy: "my_lifecycle" - - match: { my_lifecycle.policy.phases.warm.minimum_age: "1000d" } + - match: { my_lifecycle.policy.phases.warm.min_age: "1000d" } - do: indices.create: diff --git a/x-pack/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/upgraded_cluster/70_ilm.yml b/x-pack/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/upgraded_cluster/70_ilm.yml index f548d6a804786..dc323955e6035 100644 --- a/x-pack/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/upgraded_cluster/70_ilm.yml +++ b/x-pack/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/upgraded_cluster/70_ilm.yml @@ -3,7 +3,7 @@ - do: ilm.get_lifecycle: policy: "my_lifecycle" - - match: { my_lifecycle.policy.phases.warm.minimum_age: "1000d" } + - match: { my_lifecycle.policy.phases.warm.min_age: "1000d" } - do: ilm.explain_lifecycle: