blob: 32271b7ab4e4cd81966d3153e986d66fbdf299c8 [file]
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
meta: {version: "1.0"}
urtest:
description: "Verify xdebug cache-info and effective-URL response headers"
requires: {plugins: [xdebug.so]}
# No default address, so the unmapped "none" host gets NXDOMAIN at once
# instead of waiting on the host resolver.
dns: {name: "xdebug-header-dns", process_config: {default: []}}
server: {name: "xdebug-header-origin"}
client: {name: "xdebug-header-client"}
ats:
name: "xdebug-header-ts"
records_config:
proxy.config.url_remap.remap_required: 0
proxy.config.diags.debug.enabled: 0
remap_config:
- "map http://one http://127.0.0.1:{SERVER_HTTP_PORT}"
- "map http://two http://127.0.0.1:{SERVER_HTTP_PORT}/two"
- "regex_map http://three[0-9]+ http://127.0.0.1:{SERVER_HTTP_PORT}"
- "regex_map http://four http://127.0.0.1:{SERVER_HTTP_PORT}/four"
variants:
- name: "cache-info"
client: {process_config: {keys: "cache-none cache-one cache-two cache-three"}}
ats:
plugin_config: ["xdebug.so --enable=x-cache-info"]
remap_config:
- "map http://one http://127.0.0.1:{SERVER_HTTP_PORT}"
- "map http://two http://127.0.0.1:{SERVER_HTTP_PORT}"
- "regex_map http://three[0-9]+ http://127.0.0.1:{SERVER_HTTP_PORT}"
- name: "effective-url"
client: {process_config: {keys: "effective-none effective-one effective-two effective-three effective-four"}}
ats:
plugin_config: ["xdebug.so --enable=x-effective-url"]
sessions:
- transactions:
- all: {headers: {fields: [[uuid, cache-none]]}}
client-request:
method: GET
url: /argh
version: "1.1"
headers: {fields: [[Host, none], [X-Debug, X-Cache-Info]]}
server-response: {status: 599}
proxy-response:
status: 500
headers:
fields:
- [Content-Type, {value: "text/html; charset=utf-8", as: equal}]
- [X-Cache-Info, {as: absent}]
- all: {headers: {fields: [[uuid, cache-one]]}}
client-request:
method: GET
url: /argh
version: "1.1"
headers: {fields: [[Host, one], [X-Debug, X-Cache-Info]]}
server-response: &ok
status: 200
headers: {fields: [[Content-Length, 0], [Connection, close]]}
proxy-response: &cache-info
status: 200
headers:
fields:
- [X-Cache-Info, {value: "path=", as: contains}]
- [X-Cache-Info, {value: "volume=0", as: contains}]
- all: {headers: {fields: [[uuid, cache-two]]}}
client-request:
method: GET
url: /argh
version: "1.1"
headers: {fields: [[Host, two], [X-Debug, x-cache-info]]}
server-response: *ok
proxy-response: *cache-info
- all: {headers: {fields: [[uuid, cache-three]]}}
client-request:
method: GET
url: /argh
version: "1.1"
headers: {fields: [[Host, three123], [X-Debug, x-cACHE-iNFO]]}
server-response: *ok
proxy-response: *cache-info
- all: {headers: {fields: [[uuid, effective-none]]}}
client-request:
method: GET
url: /argh
version: "1.1"
headers: {fields: [[Host, none], [X-Debug, X-Effective-URL]]}
server-response: {status: 599}
proxy-response:
status: 500
headers:
fields:
- [Content-Type, {value: "text/html; charset=utf-8", as: equal}]
- [X-Effective-URL, {value: "http://none/argh", as: contains}]
- all: {headers: {fields: [[uuid, effective-one]]}}
client-request:
method: GET
url: /argh
version: "1.1"
headers: {fields: [[Host, one], [X-Debug, x-effective-url]]}
proxy-request: {url: /argh}
server-response: *ok
proxy-response:
status: 200
headers: {fields: [[X-Effective-URL, {value: "/argh", as: contains}]]}
- all: {headers: {fields: [[uuid, effective-two]]}}
client-request:
method: GET
url: /argh
version: "1.1"
headers: {fields: [[Host, two], [X-Debug, X-EFFECTIVE-URL]]}
proxy-request: {url: /two/argh}
server-response: *ok
proxy-response:
status: 200
headers: {fields: [[X-Effective-URL, {value: "/two/argh", as: contains}]]}
- all: {headers: {fields: [[uuid, effective-three]]}}
client-request:
method: GET
url: /argh
version: "1.1"
headers: {fields: [[Host, three123], [X-Debug, X-effective-url]]}
proxy-request: {url: /argh}
server-response: *ok
proxy-response:
status: 200
headers: {fields: [[X-Effective-URL, {value: "/argh", as: contains}]]}
- all: {headers: {fields: [[uuid, effective-four]]}}
client-request:
method: GET
url: /argh,urgh
version: "1.1"
headers: {fields: [[Host, four], [X-Debug, X-effective-url]]}
proxy-request: {url: "/four/argh,urgh"}
server-response: *ok
proxy-response:
status: 200
headers: {fields: [[X-Effective-URL, {value: "/four/argh,urgh", as: contains}]]}