Skip to content

Commit

Permalink
add ILM rolling upgrade tests (#32828)
Browse files Browse the repository at this point in the history
  • Loading branch information
talevy authored Oct 26, 2018
1 parent 8ce31f6 commit 5c88356
Show file tree
Hide file tree
Showing 3 changed files with 101 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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" }
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit 5c88356

Please sign in to comment.