blob: 00f0553d3aa2aced92871798e7c2aa865354e5f1 [file] [log] [blame]
Ilya Shipitsinf38a0182020-12-21 01:16:17 +05001varnishtest "Verify logging of relative/absolute URI path"
Maciej Zdebfcdfd852020-11-30 18:27:47 +00002feature ignore_unknown_macro
3
4server s1 {
5 rxreq
6 txresp
7} -repeat 4 -start
8
9syslog 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
20haproxy 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
42client 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
57syslog Slg_1 -wait
58
59client c1 -wait