---
setup:
- skip:
    features:
    - "headers"
    - "allowed_warnings_regex"
---
Help:
- do:
    cat.snapshots:
      help: true
    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:
    $body: "/^   id                .+   \\n\n     repository        .+   \\n\n   \
      \  status            .+   \\n\n     start_epoch       .+   \\n\n     start_time\
      \        .+   \\n\n     end_epoch         .+   \\n\n     end_time          .+\
      \   \\n\n     duration          .+   \\n\n     indices           .+   \\n\n\
      \     successful_shards .+   \\n\n     failed_shards     .+   \\n\n     total_shards\
      \      .+   \\n\n     reason            .+   \\n\n$/\n"
---
Test cat snapshots output:
- do:
    snapshot.create_repository:
      repository: "test_cat_snapshots_1"
      body:
        type: "fs"
        settings:
          location: "test_cat_snapshots_1_loc"
    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"
- do:
    cat.snapshots:
      repository: "test_cat_snapshots_1"
    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:
    $body: "/^$/\n"
- do:
    indices.create:
      index: "index1"
      body:
        settings:
          number_of_shards: "1"
          number_of_replicas: "0"
    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"
- do:
    indices.create:
      index: "index2"
      body:
        settings:
          number_of_shards: "1"
          number_of_replicas: "0"
    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"
- do:
    cluster.health:
      wait_for_status: "green"
    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"
- do:
    snapshot.create:
      repository: "test_cat_snapshots_1"
      snapshot: "snap1"
      wait_for_completion: true
      body:
        feature_states:
        - "none"
    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"
- do:
    snapshot.create:
      repository: "test_cat_snapshots_1"
      snapshot: "snap2"
      wait_for_completion: true
      body:
        feature_states:
        - "none"
    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"
- do:
    cat.snapshots:
      repository: "test_cat_snapshots_1"
    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:
    $body: "/^   snap1\\s+ test_cat_snapshots_1\\s+ SUCCESS\\s+ \\d+\\s+ \\d\\d\\\
      :\\d\\d\\:\\d\\d\\s+ \\d+\\s+ \\d\\d\\:\\d\\d\\:\\d\\d\\s+ \\S+\\s+ 2\\s+ 2\\\
      s+ 0\\s+ 2\\s*\\n\n     snap2\\s+ test_cat_snapshots_1\\s+ SUCCESS\\s+ \\d+\\\
      s+ \\d\\d\\:\\d\\d\\:\\d\\d\\s+ \\d+\\s+ \\d\\d\\:\\d\\d\\:\\d\\d\\s+ \\S+\\\
      s+ 2\\s+ 2\\s+ 0\\s+ 2\\s*\\n\n$/\n"
