| meta: | |
| version: "1.0" | |
| # Really just a smoke test, as it's not currently possible to source the requests from | |
| # different IP addresses. | |
| txn_box: | |
| global: | |
| - when: ua-req | |
| do: | |
| - with: inbound-addr-remote | |
| select: | |
| - eq: 127.0.0.1 | |
| do: | |
| - txn-conf<proxy.config.http.insert_request_via_str>: 1 | |
| - in: 127.0.0.0/8 | |
| do: | |
| - txn-conf<proxy.config.http.insert_request_via_str>: 1 | |
| - ua-req-field<via>: [ ua-req-field<via> , { concat: [ "," , "non-standard loopback" ] } ] | |
| - when: proxy-req | |
| do: | |
| - with: outbound-addr-remote | |
| select: | |
| - eq: 127.0.0.1 | |
| do: | |
| - proxy-req-field<outbound-addr-remote>: "Smoke-Test-Ok" | |
| - when: proxy-req | |
| do: | |
| - with: outbound-addr-local | |
| select: | |
| - eq: 127.0.0.1 | |
| do: | |
| - proxy-req-field<outbound-addr-local>: "Smoke-Test-Ok" | |
| blocks: | |
| - base-req: &base-req | |
| version: "1.1" | |
| method: "GET" | |
| - base-rsp: &base-rsp | |
| status: 200 | |
| reason: "OK" | |
| headers: | |
| fields: | |
| - [ Content-Type, html/plaintext ] | |
| - [ Content-Length, 96 ] | |
| sessions: | |
| - protocol: # plain text sessions | |
| stack: http | |
| transactions: | |
| # | |
| - all: { headers: { fields: [[ uuid, 1 ]]}} | |
| client-request: | |
| <<: *base-req | |
| url: "/delain" | |
| headers: | |
| fields: | |
| - [ Host, one.ex ] | |
| proxy-request: | |
| headers: | |
| fields: | |
| - [ "via", { value: "traffic_server", as: contains } ] | |
| - [ "outbound-addr-local", { value: "Smoke-Test-Ok", as: equal } ] | |
| - [ "outbound-addr-remote", { value: "Smoke-Test-Ok", as: equal } ] | |
| server-response: | |
| <<: *base-rsp | |
| proxy-response: | |
| <<: *base-rsp | |
| urtest: | |
| description: Verify txn_box IP address values | |
| requires: | |
| plugins: | |
| - txn_box.so | |
| server: | |
| name: txn-box-ip-addr-origin | |
| client: | |
| name: txn-box-ip-addr-client | |
| ats: | |
| name: txn-box-ip-addr-ts | |
| records_config: | |
| proxy.config.diags.debug.enabled: 1 | |
| proxy.config.diags.debug.tags: txn_box | |
| proxy.config.http.insert_request_via_str: 0 | |
| copy_to_config_dir: | |
| - ip-addr.test.yaml | |
| remap_config: | |
| - map / http://127.0.0.1:{SERVER_HTTP_PORT} | |
| plugin_config: | |
| - txn_box.so | |
| - txn_box.so --key meta.txn_box.global {CONFIG_DIR}/ip-addr.test.yaml |