From 4fcde65f6c02fe5fd325c2c30ca3ecf81bc67a69 Mon Sep 17 00:00:00 2001 From: Tal Levy Date: Mon, 13 Aug 2018 16:28:43 -0700 Subject: [PATCH 1/6] add ILM rolling upgrade tests --- .../test/mixed_cluster/70_ilm.yml | 23 ++++++++++++ .../rest-api-spec/test/old_cluster/70_ilm.yml | 37 +++++++++++++++++++ .../test/upgraded_cluster/70_ilm.yml | 26 +++++++++++++ 3 files changed, 86 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..71ab99e87876d --- /dev/null +++ b/x-pack/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/mixed_cluster/70_ilm.yml @@ -0,0 +1,23 @@ +--- +"Test Set Policy On Index": + - do: + acknowledge: true + ilm.get_lifecycle: + lifecycle: "my_lifecycle" + - match: { my_timeseries_lifecycle.phases.warm.after: "1000d" } + + - do: + indices.create: + index: my_index + body: + settings: + index.lifecycle.name: "my_lifecycle" + + - do: + acknowledge: true + ilm.explain_lifecycle: + index: "my_index" + + - is_true: indices.my_index.managed + - match: { indices.my_index.index: "my_index" } + - match: { indices.my_index.policy: "my_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 new file mode 100644 index 0000000000000..312608c25bf90 --- /dev/null +++ b/x-pack/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/old_cluster/70_ilm.yml @@ -0,0 +1,37 @@ +--- +"Test Basic Policy Creation": + - do: + catch: missing + ilm.get_lifecycle: + lifecycle: "my_lifecycle" + + - do: + catch: missing + ilm.delete_lifecycle: + lifecycle: "my_lifecycle" + + - do: + acknowlege: true + ilm.put_lifecycle: + lifecycle: "my_lifecycle" + body: | + { + "policy": { + "phases": { + "warm": { + "after": "1000d", + "actions": { + "forcemerge": { + "max_num_segments": 10000 + } + } + } + } + } + } + + - do: + acknowledge: true + ilm.get_lifecycle: + lifecycle: "my_lifecycle" + - match: { my_timeseries_lifecycle.phases.warm.after: "1000d" } 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..fcd202e0e8307 --- /dev/null +++ b/x-pack/qa/rolling-upgrade/src/test/resources/rest-api-spec/test/upgraded_cluster/70_ilm.yml @@ -0,0 +1,26 @@ +--- +"Test Lifecycle Still There And Indices Are Still Managed": + - do: + acknowledge: true + ilm.get_lifecycle: + lifecycle: "my_lifecycle" + - match: { my_timeseries_lifecycle.phases.warm.after: "1000d" } + + - do: + acknowledge: true + ilm.explain_lifecycle: + index: "my_index" + + - is_true: indices.my_index.managed + - match: { indices.my_index.index: "my_index" } + - match: { indices.my_index.policy: "my_lifecycle" } + + - do: + acknowledge: true + indices.delete: + index: my_index + + - do: + acknowledge: true + ilm.delete_lifecycle: + lifecycle: "my_lifecycle" From bbd3291d8a32bda8f2a79a72333af3e4231918f0 Mon Sep 17 00:00:00 2001 From: Lee Hinman Date: Wed, 3 Oct 2018 14:36:45 -0600 Subject: [PATCH 2/6] Update for newer syntax --- .../rest-api-spec/test/mixed_cluster/70_ilm.yml | 4 ++-- .../rest-api-spec/test/old_cluster/70_ilm.yml | 12 ++++++------ .../rest-api-spec/test/upgraded_cluster/70_ilm.yml | 6 +++--- 3 files changed, 11 insertions(+), 11 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 71ab99e87876d..a5a56dd33c771 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,8 +3,8 @@ - do: acknowledge: true ilm.get_lifecycle: - lifecycle: "my_lifecycle" - - match: { my_timeseries_lifecycle.phases.warm.after: "1000d" } + policy: "my_lifecycle" + - match: { my_timeseries_lifecycle.phases.warm.minimum_age: "1000d" } - do: indices.create: 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 312608c25bf90..fb3f417df30e1 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 @@ -3,23 +3,23 @@ - do: catch: missing ilm.get_lifecycle: - lifecycle: "my_lifecycle" + policy: "my_lifecycle" - do: catch: missing ilm.delete_lifecycle: - lifecycle: "my_lifecycle" + policy: "my_lifecycle" - do: acknowlege: true ilm.put_lifecycle: - lifecycle: "my_lifecycle" + policy: "my_lifecycle" body: | { "policy": { "phases": { "warm": { - "after": "1000d", + "minimum_age": "1000d", "actions": { "forcemerge": { "max_num_segments": 10000 @@ -33,5 +33,5 @@ - do: acknowledge: true ilm.get_lifecycle: - lifecycle: "my_lifecycle" - - match: { my_timeseries_lifecycle.phases.warm.after: "1000d" } + policy: "my_lifecycle" + - match: { my_timeseries_lifecycle.phases.warm.minimum_age: "1000d" } 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 fcd202e0e8307..5646f42df5460 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,8 +3,8 @@ - do: acknowledge: true ilm.get_lifecycle: - lifecycle: "my_lifecycle" - - match: { my_timeseries_lifecycle.phases.warm.after: "1000d" } + policy: "my_lifecycle" + - match: { my_timeseries_lifecycle.phases.warm.minimum_age: "1000d" } - do: acknowledge: true @@ -23,4 +23,4 @@ - do: acknowledge: true ilm.delete_lifecycle: - lifecycle: "my_lifecycle" + policy: "my_lifecycle" From 75dc24aa924955e0f8189e53b91e37c7242a1454 Mon Sep 17 00:00:00 2001 From: Tal Levy Date: Wed, 24 Oct 2018 13:08:49 -0700 Subject: [PATCH 3/6] fix further syntax issues --- .../test/mixed_cluster/70_ilm.yml | 17 +++++++------- .../rest-api-spec/test/old_cluster/70_ilm.yml | 6 ++--- .../test/upgraded_cluster/70_ilm.yml | 23 +++++++++---------- 3 files changed, 22 insertions(+), 24 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 a5a56dd33c771..583a8fe94dd32 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 @@ -1,7 +1,7 @@ --- "Test Set Policy On Index": - do: - acknowledge: true + acknowledged: true ilm.get_lifecycle: policy: "my_lifecycle" - match: { my_timeseries_lifecycle.phases.warm.minimum_age: "1000d" } @@ -13,11 +13,10 @@ settings: index.lifecycle.name: "my_lifecycle" - - do: - acknowledge: true - ilm.explain_lifecycle: - index: "my_index" - - - is_true: indices.my_index.managed - - match: { indices.my_index.index: "my_index" } - - match: { indices.my_index.policy: "my_lifecycle" } + - do: + acknowledged: true + ilm.explain_lifecycle: + index: "my_index" + - is_true: indices.my_index.managed + - match: { indices.my_index.index: "my_index" } + - match: { indices.my_index.policy: "my_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 fb3f417df30e1..081189fe028cf 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 @@ -11,7 +11,7 @@ policy: "my_lifecycle" - do: - acknowlege: true + acknowledged: true ilm.put_lifecycle: policy: "my_lifecycle" body: | @@ -31,7 +31,7 @@ } - do: - acknowledge: true + acknowledged: true ilm.get_lifecycle: policy: "my_lifecycle" - - match: { my_timeseries_lifecycle.phases.warm.minimum_age: "1000d" } + - match: { my_lifecycle.policy.phases.warm.minimum_age: "1000d" } 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 5646f42df5460..a3a4e2d9d4f85 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 @@ -1,26 +1,25 @@ --- "Test Lifecycle Still There And Indices Are Still Managed": - do: - acknowledge: true + acknowledged: true ilm.get_lifecycle: policy: "my_lifecycle" - - match: { my_timeseries_lifecycle.phases.warm.minimum_age: "1000d" } + - match: { my_lifecycle.policy.phases.warm.minimum_age: "1000d" } - - do: - acknowledge: true - ilm.explain_lifecycle: - index: "my_index" - - - is_true: indices.my_index.managed - - match: { indices.my_index.index: "my_index" } - - match: { indices.my_index.policy: "my_lifecycle" } + - do: + acknowledged: true + ilm.explain_lifecycle: + index: "my_index" + - is_true: indices.my_index.managed + - match: { indices.my_index.index: "my_index" } + - match: { indices.my_index.policy: "my_lifecycle" } - do: - acknowledge: true + acknowledged: true indices.delete: index: my_index - do: - acknowledge: true + acknowledged: true ilm.delete_lifecycle: policy: "my_lifecycle" From 6c74320df6db138162040e0026e40138698e89ea Mon Sep 17 00:00:00 2001 From: Tal Levy Date: Wed, 24 Oct 2018 13:18:31 -0700 Subject: [PATCH 4/6] fix last mention of the timeseries policy --- .../test/resources/rest-api-spec/test/mixed_cluster/70_ilm.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 583a8fe94dd32..849339f8f3ae6 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 @@ -4,7 +4,7 @@ acknowledged: true ilm.get_lifecycle: policy: "my_lifecycle" - - match: { my_timeseries_lifecycle.phases.warm.minimum_age: "1000d" } + - match: { my_lifecycle.policy.phases.warm.minimum_age: "1000d" } - do: indices.create: From 4641b23635eea3d79ca50743c6614781cf1bea6c Mon Sep 17 00:00:00 2001 From: Tal Levy Date: Wed, 24 Oct 2018 14:21:15 -0700 Subject: [PATCH 5/6] fix tests --- .../test/mixed_cluster/70_ilm.yml | 23 +++++++++++++++---- .../rest-api-spec/test/old_cluster/70_ilm.yml | 15 ++++++++++++ .../test/upgraded_cluster/70_ilm.yml | 14 +++++------ 3 files changed, 40 insertions(+), 12 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 849339f8f3ae6..50c65a79c2d69 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 @@ -6,9 +6,17 @@ policy: "my_lifecycle" - match: { my_lifecycle.policy.phases.warm.minimum_age: "1000d" } + - do: + acknowledged: true + 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_index + index: my_mixed_index body: settings: index.lifecycle.name: "my_lifecycle" @@ -16,7 +24,12 @@ - do: acknowledged: true ilm.explain_lifecycle: - index: "my_index" - - is_true: indices.my_index.managed - - match: { indices.my_index.index: "my_index" } - - match: { indices.my_index.policy: "my_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: + acknowledged: true + 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 index 081189fe028cf..d85a2dae631df 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 @@ -35,3 +35,18 @@ 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: + acknowledged: true + 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 index a3a4e2d9d4f85..1354f69ac9e90 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 @@ -9,15 +9,15 @@ - do: acknowledged: true ilm.explain_lifecycle: - index: "my_index" - - is_true: indices.my_index.managed - - match: { indices.my_index.index: "my_index" } - - match: { indices.my_index.policy: "my_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: - acknowledged: true - indices.delete: - index: my_index + acknowledged: true + indices.delete: + index: my_old_index - do: acknowledged: true From 272407e9775c1fdb5ce3cf45bc71cc2e891ea240 Mon Sep 17 00:00:00 2001 From: Tal Levy Date: Thu, 25 Oct 2018 15:22:27 -0700 Subject: [PATCH 6/6] drop usage of acknowledged --- .../resources/rest-api-spec/test/mixed_cluster/70_ilm.yml | 4 ---- .../test/resources/rest-api-spec/test/old_cluster/70_ilm.yml | 3 --- .../resources/rest-api-spec/test/upgraded_cluster/70_ilm.yml | 4 ---- 3 files changed, 11 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 50c65a79c2d69..d444d5fefeee0 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 @@ -1,13 +1,11 @@ --- "Test Set Policy On Index": - do: - acknowledged: true ilm.get_lifecycle: policy: "my_lifecycle" - match: { my_lifecycle.policy.phases.warm.minimum_age: "1000d" } - do: - acknowledged: true ilm.explain_lifecycle: index: "my_old_index" - is_true: indices.my_old_index.managed @@ -22,7 +20,6 @@ index.lifecycle.name: "my_lifecycle" - do: - acknowledged: true ilm.explain_lifecycle: index: "my_mixed_index" - is_true: indices.my_mixed_index.managed @@ -30,6 +27,5 @@ - match: { indices.my_mixed_index.policy: "my_lifecycle" } - do: - acknowledged: true 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 index d85a2dae631df..d2c92de684a06 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 @@ -11,7 +11,6 @@ policy: "my_lifecycle" - do: - acknowledged: true ilm.put_lifecycle: policy: "my_lifecycle" body: | @@ -31,7 +30,6 @@ } - do: - acknowledged: true ilm.get_lifecycle: policy: "my_lifecycle" - match: { my_lifecycle.policy.phases.warm.minimum_age: "1000d" } @@ -44,7 +42,6 @@ index.lifecycle.name: "my_lifecycle" - do: - acknowledged: true ilm.explain_lifecycle: index: "my_old_index" - is_true: indices.my_old_index.managed 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 1354f69ac9e90..f548d6a804786 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 @@ -1,13 +1,11 @@ --- "Test Lifecycle Still There And Indices Are Still Managed": - do: - acknowledged: true ilm.get_lifecycle: policy: "my_lifecycle" - match: { my_lifecycle.policy.phases.warm.minimum_age: "1000d" } - do: - acknowledged: true ilm.explain_lifecycle: index: "my_old_index" - is_true: indices.my_old_index.managed @@ -15,11 +13,9 @@ - match: { indices.my_old_index.policy: "my_lifecycle" } - do: - acknowledged: true indices.delete: index: my_old_index - do: - acknowledged: true ilm.delete_lifecycle: policy: "my_lifecycle"