Ilya Shipitsin | f38a018 | 2020-12-21 01:16:17 +0500 | [diff] [blame] | 1 | varnishtest "Verify logging of relative/absolute URI path" |
Maciej Zdeb | fcdfd85 | 2020-11-30 18:27:47 +0000 | [diff] [blame] | 2 | feature ignore_unknown_macro |
| 3 | |
Christopher Faulet | 85a8136 | 2020-12-15 17:13:39 +0100 | [diff] [blame] | 4 | #REQUIRE_VERSION=2.4 |
| 5 | |
Maciej Zdeb | fcdfd85 | 2020-11-30 18:27:47 +0000 | [diff] [blame] | 6 | server s1 { |
| 7 | rxreq |
| 8 | txresp |
| 9 | } -repeat 4 -start |
| 10 | |
| 11 | syslog Slg_1 -level info { |
| 12 | recv |
| 13 | expect ~ "[^:\\[ ]\\[${h1_pid}\\]: .* hpo=/r/1 hp=/r/1 hu=/r/1 hq=" |
| 14 | recv |
| 15 | expect ~ "[^:\\[ ]\\[${h1_pid}\\]: .* hpo=/r/2 hp=/r/2 hu=/r/2\\?q=2 hq=\\?q=2" |
| 16 | recv |
| 17 | expect ~ "[^:\\[ ]\\[${h1_pid}\\]: .* hpo=/r/3 hp=http://localhost/r/3 hu=http://localhost/r/3 hq=" |
| 18 | recv |
| 19 | expect ~ "[^:\\[ ]\\[${h1_pid}\\]: .* hpo=/r/4 hp=http://localhost/r/4 hu=http://localhost/r/4\\?q=4 hq=\\?q=4" |
| 20 | } -start |
| 21 | |
| 22 | haproxy h1 -conf { |
| 23 | global |
| 24 | nbthread 1 |
| 25 | |
| 26 | defaults |
| 27 | mode http |
| 28 | option httplog |
| 29 | timeout connect 1000 |
| 30 | timeout client 1000 |
| 31 | timeout server 1000 |
| 32 | |
| 33 | frontend fe1 |
| 34 | bind "fd@${fe_1}" |
| 35 | log ${Slg_1_addr}:${Slg_1_port} local0 |
| 36 | log-format "ci:%cp [%tr] hpo=%HPO hp=%HP hu=%HU hq=%HQ" |
| 37 | default_backend be |
| 38 | |
| 39 | backend be |
| 40 | server app1 ${s1_addr}:${s1_port} |
| 41 | } -start |
| 42 | |
| 43 | # The following client are started in background and synchronized |
| 44 | client c1 -connect ${h1_fe_1_sock} { |
| 45 | txreq -url "/r/1" |
| 46 | rxresp |
| 47 | expect resp.status == 200 |
| 48 | txreq -url "/r/2?q=2" |
| 49 | rxresp |
| 50 | expect resp.status == 200 |
| 51 | txreq -url "http://localhost/r/3" -hdr "host: localhost" |
| 52 | rxresp |
| 53 | expect resp.status == 200 |
| 54 | txreq -url "http://localhost/r/4?q=4" -hdr "host: localhost" |
| 55 | rxresp |
| 56 | expect resp.status == 200 |
| 57 | } -start |
| 58 | |
| 59 | syslog Slg_1 -wait |
| 60 | |
| 61 | client c1 -wait |