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