---
setup:
- skip:
    features:
    - "headers"
    - "allowed_warnings_regex"
- requires:
    cluster_features:
    - "gte_v8.2.0"
    reason: "system index attribute introduced in 8.2"
    test_runner_features: "warnings"
- do:
    indices.create:
      index: ".tasks"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
---
teardown:
- skip:
    features:
    - "warnings"
    - "headers"
    - "allowed_warnings_regex"
    reason: "these tests manipulate system indices, so we get warnings"
- do:
    indices.delete:
      index: ".tasks"
    warnings:
    - "this request accesses system indices: [.tasks], but in a future major version,\
      \ direct access to system indices will be prevented by default"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
---
Resolve system index:
- do:
    indices.resolve_index:
      name: ".tasks"
      expand_wildcards:
      - "all"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- match:
    indices.0.name: ".tasks"
- match:
    indices.0.attributes.0: "hidden"
- match:
    indices.0.attributes.1: "open"
- match:
    indices.0.attributes.2: "system"
