---
setup:
- skip:
    features:
    - "headers"
    - "allowed_warnings_regex"
- do:
    cluster.health:
      wait_for_status: "yellow"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - ".*rollup functionality will be removed in Elasticsearch.*"
    - "Index \\[\\.profiling-.*\\] name begins with a dot.* and will not be allowed\
      \ in a future Elasticsearch version."
    - "Parameter \\[default_metric\\] is deprecated and will be removed in a future\
      \ version"
---
Test use prohibited query inside role query:
- do:
    catch: "/terms query with terms lookup isn't supported as part of a role query/"
    security.put_role:
      name: "role"
      body: "{\n  \"cluster\": [\"all\"],\n  \"indices\": [\n    {\n      \"names\"\
        : \"index\",\n      \"privileges\": [\"all\"],\n      \"query\" : {\n    \
        \    \"terms\" : { \"field\" : { \"index\" : \"_index\", \"id\" : \"_id\"\
        , \"path\" : \"_path\"} }\n      }\n    }\n  ]\n}\n"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - ".*rollup functionality will be removed in Elasticsearch.*"
    - "Index \\[\\.profiling-.*\\] name begins with a dot.* and will not be allowed\
      \ in a future Elasticsearch version."
    - "Parameter \\[default_metric\\] is deprecated and will be removed in a future\
      \ version"
