|
| 1 | +setup: |
| 2 | + - requires: |
| 3 | + test_runner_features: [ capabilities, allowed_warnings ] |
| 4 | + reason: "Exposing failures lifecycle config in templates was added in 9.1+" |
| 5 | + capabilities: |
| 6 | + - method: GET |
| 7 | + path: /_data_stream/{target} |
| 8 | + capabilities: [ 'failure_store.lifecycle' ] |
| 9 | + - do: |
| 10 | + allowed_warnings: |
| 11 | + - "index template [my-template1] has index patterns [fs-data-stream] matching patterns from existing older templates [global] with patterns (global => [*]); this template [my-template1] will take precedence during new index creation" |
| 12 | + indices.put_index_template: |
| 13 | + name: my-template1 |
| 14 | + body: |
| 15 | + index_patterns: [fs-data-stream] |
| 16 | + template: |
| 17 | + settings: |
| 18 | + index.number_of_replicas: 1 |
| 19 | + mappings: |
| 20 | + properties: |
| 21 | + '@timestamp': |
| 22 | + type: date |
| 23 | + count: |
| 24 | + type: long |
| 25 | + lifecycle: {} |
| 26 | + data_stream_options: |
| 27 | + failure_store: |
| 28 | + enabled: true |
| 29 | + data_stream: {} |
| 30 | + |
| 31 | + - do: |
| 32 | + allowed_warnings: |
| 33 | + - "index template [my-template2] has index patterns [fs-default-*] matching patterns from existing older templates [global] with patterns (global => [*]); this template [my-template2] will take precedence during new index creation" |
| 34 | + indices.put_index_template: |
| 35 | + name: my-template2 |
| 36 | + body: |
| 37 | + index_patterns: [ fs-default-* ] |
| 38 | + template: |
| 39 | + settings: |
| 40 | + index.number_of_replicas: 1 |
| 41 | + mappings: |
| 42 | + properties: |
| 43 | + '@timestamp': |
| 44 | + type: date |
| 45 | + count: |
| 46 | + type: long |
| 47 | + lifecycle: {} |
| 48 | + data_stream: { } |
| 49 | + |
| 50 | + - do: |
| 51 | + allowed_warnings: |
| 52 | + - "index template [my-template3] has index patterns [no-fs-*] matching patterns from existing older templates [global] with patterns (global => [*]); this template [my-template3] will take precedence during new index creation" |
| 53 | + indices.put_index_template: |
| 54 | + name: my-template3 |
| 55 | + body: |
| 56 | + index_patterns: [ no-fs-* ] |
| 57 | + template: |
| 58 | + settings: |
| 59 | + index.number_of_replicas: 1 |
| 60 | + mappings: |
| 61 | + properties: |
| 62 | + '@timestamp': |
| 63 | + type: date |
| 64 | + count: |
| 65 | + type: long |
| 66 | + data_stream: { } |
| 67 | + |
| 68 | + - do: |
| 69 | + cluster.put_settings: |
| 70 | + body: |
| 71 | + persistent: |
| 72 | + data_streams.failure_store.enabled: 'fs-default*' |
| 73 | + |
| 74 | +--- |
| 75 | +teardown: |
| 76 | + - do: |
| 77 | + indices.delete_data_stream: |
| 78 | + name: fs-data-stream |
| 79 | + ignore: 404 |
| 80 | + |
| 81 | + - do: |
| 82 | + indices.delete_index_template: |
| 83 | + name: fs-default-data-stream |
| 84 | + ignore: 404 |
| 85 | + |
| 86 | + - do: |
| 87 | + indices.delete_index_template: |
| 88 | + name: no-fs-data-stream |
| 89 | + ignore: 404 |
| 90 | + |
| 91 | +--- |
| 92 | +"Get failure store info from explicitly enabled failure store": |
| 93 | + - do: |
| 94 | + indices.create_data_stream: |
| 95 | + name: fs-data-stream |
| 96 | + - is_true: acknowledged |
| 97 | + |
| 98 | + - do: |
| 99 | + indices.get_data_stream: |
| 100 | + name: "fs-data-stream" |
| 101 | + - match: { data_streams.0.name: fs-data-stream } |
| 102 | + - match: { data_streams.0.timestamp_field.name: '@timestamp' } |
| 103 | + - match: { data_streams.0.generation: 1 } |
| 104 | + - length: { data_streams.0.indices: 1 } |
| 105 | + - match: { data_streams.0.indices.0.index_name: '/\.ds-fs-data-stream-(\d{4}\.\d{2}\.\d{2}-)?000001/' } |
| 106 | + - match: { data_streams.0.template: 'my-template1' } |
| 107 | + - match: { data_streams.0.failure_store.enabled: true } |
| 108 | + - match: { data_streams.0.failure_store.lifecycle.enabled: true} |
| 109 | + - match: { data_streams.0.failure_store.indices: [] } |
| 110 | + |
| 111 | + # Initialize failure store |
| 112 | + - do: |
| 113 | + index: |
| 114 | + index: fs-data-stream |
| 115 | + refresh: true |
| 116 | + body: |
| 117 | + '@timestamp': '2020-12-12' |
| 118 | + count: 'invalid value' |
| 119 | + |
| 120 | + - do: |
| 121 | + indices.get_data_stream: |
| 122 | + name: "fs-data-stream" |
| 123 | + - match: { data_streams.0.name: fs-data-stream } |
| 124 | + - match: { data_streams.0.timestamp_field.name: '@timestamp' } |
| 125 | + - match: { data_streams.0.generation: 2 } |
| 126 | + - length: { data_streams.0.indices: 1 } |
| 127 | + - match: { data_streams.0.indices.0.index_name: '/\.ds-fs-data-stream-(\d{4}\.\d{2}\.\d{2}-)?000001/' } |
| 128 | + - match: { data_streams.0.template: 'my-template1' } |
| 129 | + - match: { data_streams.0.failure_store.enabled: true } |
| 130 | + - match: { data_streams.0.failure_store.lifecycle.enabled: true } |
| 131 | + - length: { data_streams.0.failure_store.indices: 1 } |
| 132 | + - match: { data_streams.0.failure_store.indices.0.index_name: '/\.fs-fs-data-stream-(\d{4}\.\d{2}\.\d{2}-)?000002/' } |
| 133 | + - is_false: data_streams.0.failure_store.indices.0.prefer_ilm |
| 134 | + - match: { data_streams.0.failure_store.indices.0.managed_by: 'Data stream lifecycle' } |
| 135 | + |
| 136 | +--- |
| 137 | +"Get failure store info from disabled failure store": |
| 138 | + - do: |
| 139 | + indices.create_data_stream: |
| 140 | + name: no-fs-data-stream |
| 141 | + - is_true: acknowledged |
| 142 | + |
| 143 | + - do: |
| 144 | + indices.get_data_stream: |
| 145 | + name: "no-fs-data-stream" |
| 146 | + - match: { data_streams.0.name: no-fs-data-stream } |
| 147 | + - match: { data_streams.0.timestamp_field.name: '@timestamp' } |
| 148 | + - match: { data_streams.0.generation: 1 } |
| 149 | + - length: { data_streams.0.indices: 1 } |
| 150 | + - match: { data_streams.0.indices.0.index_name: '/\.ds-no-fs-data-stream-(\d{4}\.\d{2}\.\d{2}-)?000001/' } |
| 151 | + - match: { data_streams.0.template: 'my-template3' } |
| 152 | + - match: { data_streams.0.failure_store.enabled: false } |
| 153 | + - is_false: data_streams.0.failure_store.lifecycle |
| 154 | + - match: { data_streams.0.failure_store.indices: [] } |
| 155 | + |
| 156 | +--- |
| 157 | +"Get failure store info from explicitly enabled failure store and disabled lifecycle": |
| 158 | + - do: |
| 159 | + indices.create_data_stream: |
| 160 | + name: fs-data-stream |
| 161 | + - is_true: acknowledged |
| 162 | + |
| 163 | + - do: |
| 164 | + indices.put_data_lifecycle: |
| 165 | + name: "fs-data-stream" |
| 166 | + body: |
| 167 | + enabled: false |
| 168 | + |
| 169 | + - is_true: acknowledged |
| 170 | + |
| 171 | + # Initialize failure store |
| 172 | + - do: |
| 173 | + index: |
| 174 | + index: fs-data-stream |
| 175 | + refresh: true |
| 176 | + body: |
| 177 | + '@timestamp': '2020-12-12' |
| 178 | + count: 'invalid value' |
| 179 | + |
| 180 | + - do: |
| 181 | + indices.get_data_stream: |
| 182 | + name: "fs-data-stream" |
| 183 | + - match: { data_streams.0.name: fs-data-stream } |
| 184 | + - match: { data_streams.0.timestamp_field.name: '@timestamp' } |
| 185 | + - match: { data_streams.0.generation: 2 } |
| 186 | + - length: { data_streams.0.indices: 1 } |
| 187 | + - match: { data_streams.0.indices.0.index_name: '/\.ds-fs-data-stream-(\d{4}\.\d{2}\.\d{2}-)?000001/' } |
| 188 | + - match: { data_streams.0.template: 'my-template1' } |
| 189 | + - match: { data_streams.0.failure_store.enabled: true } |
| 190 | + - match: { data_streams.0.failure_store.lifecycle.enabled: false } |
| 191 | + - length: { data_streams.0.failure_store.indices: 1 } |
| 192 | + - match: { data_streams.0.failure_store.indices.0.index_name: '/\.fs-fs-data-stream-(\d{4}\.\d{2}\.\d{2}-)?000002/' } |
| 193 | + - is_false: data_streams.0.failure_store.indices.0.prefer_ilm |
| 194 | + - match: { data_streams.0.failure_store.indices.0.managed_by: 'Unmanaged' } |
| 195 | + |
| 196 | +--- |
| 197 | +"Get failure store info from cluster setting enabled failure store": |
| 198 | + - do: |
| 199 | + indices.create_data_stream: |
| 200 | + name: fs-default-data-stream |
| 201 | + - is_true: acknowledged |
| 202 | + |
| 203 | + - do: |
| 204 | + indices.get_data_stream: |
| 205 | + name: "fs-default-data-stream" |
| 206 | + - match: { data_streams.0.name: fs-default-data-stream } |
| 207 | + - match: { data_streams.0.timestamp_field.name: '@timestamp' } |
| 208 | + - match: { data_streams.0.generation: 1 } |
| 209 | + - length: { data_streams.0.indices: 1 } |
| 210 | + - match: { data_streams.0.indices.0.index_name: '/\.ds-fs-default-data-stream-(\d{4}\.\d{2}\.\d{2}-)?000001/' } |
| 211 | + - match: { data_streams.0.template: 'my-template2' } |
| 212 | + - match: { data_streams.0.failure_store.enabled: true } |
| 213 | + - match: { data_streams.0.failure_store.lifecycle.enabled: true } |
| 214 | + - match: { data_streams.0.failure_store.indices: [] } |
| 215 | + |
| 216 | + # Initialize failure store |
| 217 | + - do: |
| 218 | + index: |
| 219 | + index: fs-default-data-stream |
| 220 | + refresh: true |
| 221 | + body: |
| 222 | + '@timestamp': '2020-12-12' |
| 223 | + count: 'invalid value' |
| 224 | + |
| 225 | + - do: |
| 226 | + indices.get_data_stream: |
| 227 | + name: "fs-default-data-stream" |
| 228 | + - match: { data_streams.0.name: fs-default-data-stream } |
| 229 | + - match: { data_streams.0.timestamp_field.name: '@timestamp' } |
| 230 | + - match: { data_streams.0.generation: 2 } |
| 231 | + - length: { data_streams.0.indices: 1 } |
| 232 | + - match: { data_streams.0.indices.0.index_name: '/\.ds-fs-default-data-stream-(\d{4}\.\d{2}\.\d{2}-)?000001/' } |
| 233 | + - match: { data_streams.0.template: 'my-template2' } |
| 234 | + - match: { data_streams.0.failure_store.enabled: true } |
| 235 | + - match: { data_streams.0.failure_store.lifecycle.enabled: true } |
| 236 | + - length: { data_streams.0.failure_store.indices: 1 } |
| 237 | + - match: { data_streams.0.failure_store.indices.0.index_name: '/\.fs-fs-default-data-stream-(\d{4}\.\d{2}\.\d{2}-)?000002/' } |
| 238 | + - is_false: data_streams.0.failure_store.indices.0.prefer_ilm |
| 239 | + - match: { data_streams.0.failure_store.indices.0.managed_by: 'Data stream lifecycle' } |
0 commit comments