blob: 360e211aa4909934236ab1c28a520b80e892c25b [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 prefetch path arithmetic and optional capture handling"
requires: {plugins: [cachekey.so, prefetch.so]}
server:
name: "prefetch-origin"
process_config: {other_args: "--format {url}"}
client: {name: "prefetch-client"}
ats:
name: "prefetch-ts"
records_config:
proxy.config.diags.debug.enabled: 1
proxy.config.diags.debug.tags: "http|prefetch"
variants:
- name: "simple"
client: {process_config: {keys: "prefetch-simple"}}
ats:
remap_config:
- 'map http://domain.in http://127.0.0.1:{SERVER_HTTP_PORT} @plugin=cachekey.so @pparam=--remove-all-params=true @plugin=prefetch.so @pparam=--front=true @pparam=--fetch-policy=simple @pparam=--fetch-path-pattern=/(.*-)(\d+)(.*)/$1{$2+1}$3/ @pparam=--fetch-count=3'
file_checks:
- {path: "{LOG_DIR}/traffic.out", contains: "demo-4.txt", timeout: 15}
- name: "simple-no-cachekey"
client: {process_config: {keys: "prefetch-simple"}}
ats:
remap_config:
- 'map http://domain.in http://127.0.0.1:{SERVER_HTTP_PORT} @plugin=prefetch.so @pparam=--front=true @pparam=--fetch-policy=simple @pparam=--fetch-path-pattern=/(.*-)(\d+)(.*)/$1{$2+1}$3/ @pparam=--fetch-count=3'
file_checks:
- {path: "{LOG_DIR}/traffic.out", contains: "demo-4.txt", timeout: 15}
- name: "overflow-64"
client: {process_config: {keys: "prefetch-overflow"}}
ats:
remap_config:
- 'map http://domain.in http://127.0.0.1:{SERVER_HTTP_PORT} @plugin=cachekey.so @pparam=--remove-all-params=true @plugin=prefetch.so @pparam=--front=true @pparam=--fetch-policy=simple @pparam=--fetch-path-pattern=/(.*-)(\d+)(.*)/$1{$2+1}$3/ @pparam=--fetch-count=3 @pparam=--fetch-overflow=64'
file_checks:
- {path: "{LOG_DIR}/traffic.out", contains: "3594967639394", timeout: 15}
- name: "arbitrary-precision"
client: {process_config: {keys: "prefetch-bignum"}}
ats:
remap_config:
- 'map http://domain.in http://127.0.0.1:{SERVER_HTTP_PORT} @plugin=cachekey.so @pparam=--remove-all-params=true @plugin=prefetch.so @pparam=--front=true @pparam=--fetch-policy=simple @pparam=--fetch-path-pattern=/(.*-)(\d+)(.*)/$1{$2+1}$3/ @pparam=--fetch-count=3 @pparam=--fetch-overflow=bignum'
file_checks:
- {path: "{LOG_DIR}/traffic.out", contains: "3842948374928374982374982377", timeout: 15}
- name: "optional-group"
client: {process_config: {keys: "prefetch-optional"}}
ats:
remap_config:
- 'map http://domain.in http://127.0.0.1:{SERVER_HTTP_PORT} @plugin=cachekey.so @pparam=--remove-all-params=true @plugin=prefetch.so @pparam=--front=true @pparam=--fetch-policy=simple @pparam=--fetch-path-pattern=/(.*-)(\d+)(\?.*)?$/$1{$2+1}$3/ @pparam=--fetch-count=3'
file_checks:
- {path: "{LOG_DIR}/traffic.out", contains: "demo-4", timeout: 15}
log_validation:
traffic_out:
excludes:
- {expression: "invalid reference", description: "An unmatched optional group expands to an empty string"}
- name: "empty-replacement"
client: {process_config: {keys: "prefetch-empty"}}
ats:
process_config: {disable_log_checks: true}
remap_config:
- 'map http://domain.in http://127.0.0.1:{SERVER_HTTP_PORT} @plugin=cachekey.so @pparam=--remove-all-params=true @plugin=prefetch.so @pparam=--front=true @pparam=--fetch-policy=simple @pparam=--fetch-path-pattern=/(.*-)(\d+)(\?.*)?$/$3/ @pparam=--fetch-count=3'
file_checks:
- {path: "{LOG_DIR}/diags.log", contains: "produced an empty path", timeout: 15}
log_validation:
traffic_out:
excludes:
- {expression: "failed to process the pattern", description: "The empty expansion is skipped without self-prefetch"}
sessions:
- transactions:
- all: {headers: {fields: [[uuid, prefetch-simple]]}}
client-request:
method: GET
url: /texts/demo-1.txt
version: "1.1"
headers: {fields: [[Host, domain.in]]}
server-response: &cacheable
status: 200
headers: {fields: [[Cache-Control, "max-age=85000"], [Content-Length, 0], [Connection, close]]}
proxy-response: {status: 200}
- all: {headers: {fields: [[uuid, prefetch-overflow]]}}
client-request:
method: GET
url: /texts/demo-3594967639391.txt
version: "1.1"
headers: {fields: [[Host, domain.in]]}
server-response: *cacheable
proxy-response: {status: 200}
- all: {headers: {fields: [[uuid, prefetch-bignum]]}}
client-request:
method: GET
url: /texts/demo-3842948374928374982374982374.txt
version: "1.1"
headers: {fields: [[Host, domain.in]]}
server-response: *cacheable
proxy-response: {status: 200}
- all: {headers: {fields: [[uuid, prefetch-optional]]}}
client-request:
method: GET
url: /texts/demo-1
version: "1.1"
headers: {fields: [[Host, domain.in]]}
server-response: *cacheable
proxy-response: {status: 200}
- all: {headers: {fields: [[uuid, prefetch-empty]]}}
client-request:
method: GET
url: /texts/demo-empty-1
version: "1.1"
headers: {fields: [[Host, domain.in]]}
server-response: *cacheable
proxy-response: {status: 200}
- client-request: {method: GET, url: /texts/demo-2.txt, version: "1.1", headers: {fields: [[Host, domain.in], [uuid, simple-2]]}}
server-response: *cacheable
- client-request: {method: GET, url: /texts/demo-3.txt, version: "1.1", headers: {fields: [[Host, domain.in], [uuid, simple-3]]}}
server-response: *cacheable
- client-request: {method: GET, url: /texts/demo-4.txt, version: "1.1", headers: {fields: [[Host, domain.in], [uuid, simple-4]]}}
server-response: *cacheable
- client-request: {method: GET, url: /texts/demo-3594967639392.txt, version: "1.1", headers: {fields: [[Host, domain.in], [uuid, overflow-2]]}}
server-response: *cacheable
- client-request: {method: GET, url: /texts/demo-3594967639393.txt, version: "1.1", headers: {fields: [[Host, domain.in], [uuid, overflow-3]]}}
server-response: *cacheable
- client-request: {method: GET, url: /texts/demo-3594967639394.txt, version: "1.1", headers: {fields: [[Host, domain.in], [uuid, overflow-4]]}}
server-response: *cacheable
- client-request: {method: GET, url: /texts/demo-3842948374928374982374982375.txt, version: "1.1", headers: {fields: [[Host, domain.in], [uuid, bignum-2]]}}
server-response: *cacheable
- client-request: {method: GET, url: /texts/demo-3842948374928374982374982376.txt, version: "1.1", headers: {fields: [[Host, domain.in], [uuid, bignum-3]]}}
server-response: *cacheable
- client-request: {method: GET, url: /texts/demo-3842948374928374982374982377.txt, version: "1.1", headers: {fields: [[Host, domain.in], [uuid, bignum-4]]}}
server-response: *cacheable
- client-request: {method: GET, url: /texts/demo-2, version: "1.1", headers: {fields: [[Host, domain.in], [uuid, optional-2]]}}
server-response: *cacheable
- client-request: {method: GET, url: /texts/demo-3, version: "1.1", headers: {fields: [[Host, domain.in], [uuid, optional-3]]}}
server-response: *cacheable
- client-request: {method: GET, url: /texts/demo-4, version: "1.1", headers: {fields: [[Host, domain.in], [uuid, optional-4]]}}
server-response: *cacheable