blob: 2caf291910cd93b334f2d9e8a37794c295b17625 [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 plugin.yaml inline configuration and disabled plugin entries"
requires: {plugins: [header_rewrite.so, xdebug.so]}
server: {name: "plugin-yaml-origin"}
client: {name: "plugin-yaml-client"}
ats:
name: "plugin-yaml-ts"
process_config: {enable_cache: false}
records_config:
proxy.config.url_remap.remap_required: 0
proxy.config.diags.debug.enabled: 1
proxy.config.diags.debug.tags: "header_rewrite|plugin"
remap_config:
- "map http://example.com http://127.0.0.1:{SERVER_HTTP_PORT}"
inline_config_files:
plugin.yaml: |
plugins:
- path: header_rewrite.so
config: |
cond %{SEND_RESPONSE_HDR_HOOK}
set-header X-Plugin-YAML "loaded-from-inline"
- path: xdebug.so
enabled: false
params: ["--enable=x-cache"]
file_checks:
- {path: "{LOG_DIR}/diags.log", contains: "plugin.yaml loading"}
- {path: "{LOG_DIR}/diags.log", contains: "skipped"}
sessions:
- transactions:
- all: {headers: {fields: [[uuid, plugin-yaml-inline]]}}
client-request:
method: GET
url: /test
version: "1.1"
headers: {fields: [[Host, example.com]]}
server-response: &response
status: 200
headers: {fields: [[Content-Length, 0], [Connection, close]]}
proxy-response:
status: 200
headers: {fields: [[X-Plugin-YAML, loaded-from-inline]]}
- all: {headers: {fields: [[uuid, plugin-yaml-disabled]]}}
client-request:
method: GET
url: /test
version: "1.1"
headers: {fields: [[Host, example.com], [X-Debug, x-cache]]}
server-response: *response
proxy-response:
status: 200
headers: {fields: [[X-Plugin-YAML, loaded-from-inline], [X-Cache, {as: absent}]]}