blob: 3a973508d1a63d6649a126f1ecdbaaab8c16fd8c [file]
urtest:
description: "Verify statichit response bodies and options"
requires:
plugins: ["statichit.so"]
server:
name: "statichit-unused-origin"
client:
name: "statichit-client"
ats:
name: "statichit-ts"
records_config:
proxy.config.diags.debug.enabled: 1
proxy.config.diags.debug.tags: "http|statichit"
copy_to_config_dir:
- "small_body.txt"
- "story_16.json"
- "empty.txt"
remap_config:
- "map http://fqdn1 http://127.0.0.1/ @plugin=statichit.so @pparam=--file-path={CONFIG_DIR}/small_body.txt"
- "map http://fqdn2 http://127.0.0.1/ @plugin=statichit.so @pparam=--file-path={CONFIG_DIR}/small_body.txt @pparam=--max-age=123"
- "map http://fqdn3 http://127.0.0.1/ @plugin=statichit.so @pparam=--file-path={CONFIG_DIR}/small_body.txt @pparam=--success-code=200 @pparam=--disable-exact @pparam=--failure-code=222"
- "map http://fqdn4 http://127.0.0.1/ @plugin=statichit.so @pparam=--file-path=invalid @pparam=--success-code=200 @pparam=--failure-code=412"
- "map http://fqdn5 http://127.0.0.1/ @plugin=statichit.so @pparam=--file-path={CONFIG_DIR}/story_16.json @pparam=--success-code=200 @pparam=--failure-code=412 @pparam=--mime-type=application/json"
- "map http://fqdn6 http://127.0.0.1/ @plugin=statichit.so @pparam=--file-path={CONFIG_DIR}/empty.txt @pparam=--success-code=200 @pparam=--failure-code=222"
- "map http://fqdn7 http://127.0.0.1/ @plugin=statichit.so @pparam=--file-path={CONFIG_DIR}/small_body.txt @pparam=--success-code @pparam=200 @pparam=--disable-exact @pparam=--failure-code @pparam=222"
- "map http://fqdn8 http://127.0.0.1/ @plugin=statichit.so @pparam=--file-path={CONFIG_DIR}/small_body.txt @pparam=-s @pparam=200 @pparam=-d @pparam=-c @pparam=222"
- "map http://fqdn9 http://127.0.0.1/ @plugin=statichit.so @pparam=--file-path={CONFIG_DIR}"
# 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.
# This replay file tests the stale response plugin when no
# --stale-while-revalidate-default and no --stale-if-error-default are
# specified.
sessions:
- transactions:
- client-request:
method: GET
url: /
version: '1.1'
headers:
fields:
- [ Host, fqdn1 ]
- [ uuid, 1 ]
proxy-request:
expect: absent
proxy-response:
status: 200
headers:
fields:
- [ Content-Length, { value: 19, as: equal } ]
- [ Cache-Control, { value: no-cache, as: equal } ]
- [ Content-Type, { value: text/plain, as: equal } ]
- [ Server, { value: ATS, as: contains } ]
content:
encoding: plain
data: |
small body content
verify: { as: equal }
- client-request:
method: GET
url: /path
version: '1.1'
headers:
fields:
- [ Host, fqdn1 ]
- [ uuid, 2 ]
proxy-request:
expect: absent
proxy-response:
status: 404
headers:
fields:
- [ Cache-Control, { value: no-store, as: equal } ]
- [ Content-Type, { value: "text/html; charset=utf-8", as: equal } ]
- [ Server, { value: ATS, as: contains } ]
content:
encoding: plain
data: Error
verify: { as: contains }
- client-request:
method: GET
url: /
version: '1.1'
headers:
fields:
- [ Host, fqdn2 ]
- [ uuid, 3 ]
proxy-request:
expect: absent
proxy-response:
status: 200
headers:
fields:
- [ Content-Length, { value: 19, as: equal } ]
- [ Cache-Control, { value: max-age=123, as: equal } ]
- [ Content-Type, { value: text/plain, as: equal } ]
- [ Server, { value: ATS, as: contains } ]
content:
encoding: plain
data: |
small body content
verify: { as: equal }
- client-request:
method: GET
url: /path
version: '1.1'
headers:
fields:
- [ Host, fqdn3 ]
- [ uuid, 4 ]
proxy-request:
expect: absent
proxy-response:
status: 200
headers:
fields:
- [ Content-Length, { value: 19, as: equal } ]
- [ Cache-Control, { value: no-cache, as: equal } ]
- [ Content-Type, { value: text/plain, as: equal } ]
- [ Server, { value: ATS, as: contains } ]
content:
encoding: plain
data: |
small body content
verify: { as: equal }
- client-request:
method: GET
url: /
version: '1.1'
headers:
fields:
- [ Host, fqdn4 ]
- [ uuid, 5 ]
proxy-request:
expect: absent
proxy-response:
status: 412
headers:
fields:
- [ Server, { value: ATS, as: contains } ]
- client-request:
method: GET
url: /
version: '1.1'
headers:
fields:
- [ Host, fqdn5 ]
- [ uuid, 6 ]
proxy-request:
expect: absent
proxy-response:
status: 200
headers:
fields:
- [ Content-Length, { value: 10917, as: equal } ]
- [ Cache-Control, { value: no-cache, as: equal } ]
- [ Content-Type, { value: application/json, as: equal } ]
- [ Server, { value: ATS, as: contains } ]
content:
encoding: plain
data: http://en.wikipedia.org/wiki/Main_Page
verify: { as: contains }
- client-request:
method: GET
url: /
version: '1.1'
headers:
fields:
- [ Host, fqdn6 ]
- [ uuid, 7 ]
proxy-request:
expect: absent
proxy-response:
status: 200
headers:
fields:
- [ Content-Length, { value: 0, as: equal } ]
- [ Cache-Control, { value: no-cache, as: equal } ]
- [ Content-Type, { value: text/plain, as: equal } ]
- [ Server, { value: ATS, as: contains } ]
- client-request:
method: GET
url: /path
version: '1.1'
headers:
fields:
- [ Host, fqdn7 ]
- [ uuid, 8 ]
proxy-request:
expect: absent
proxy-response:
status: 200
headers:
fields:
- [ Content-Length, { value: 19, as: equal } ]
- [ Cache-Control, { value: no-cache, as: equal } ]
- [ Content-Type, { value: text/plain, as: equal } ]
- [ Server, { value: ATS, as: contains } ]
content:
encoding: plain
data: |
small body content
verify: { as: equal }
- client-request:
method: GET
url: /path
version: '1.1'
headers:
fields:
- [ Host, fqdn8 ]
- [ uuid, 8 ]
proxy-request:
expect: absent
proxy-response:
status: 200
headers:
fields:
- [ Content-Length, { value: 19, as: equal } ]
- [ Cache-Control, { value: no-cache, as: equal } ]
- [ Content-Type, { value: text/plain, as: equal } ]
- [ Server, { value: ATS, as: contains } ]
content:
encoding: plain
data: |
small body content
verify: { as: equal }
- client-request:
method: GET
url: /small_body.txt
version: '1.1'
headers:
fields:
- [ Host, fqdn9 ]
- [ uuid, 9 ]
proxy-request:
expect: absent
proxy-response:
status: 200
headers:
fields:
- [ Content-Length, { value: 19, as: equal } ]
- [ Cache-Control, { value: no-cache, as: equal } ]
- [ Content-Type, { value: text/plain, as: equal } ]
- [ Server, { value: ATS, as: contains } ]
content:
encoding: plain
data: |
small body content
verify: { as: equal }