blob: b5a5753fb01b25b7cc755340b4e85af3ca8a64e5 [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
Christopher Faulet85a81362020-12-15 17:13:39 +01004#REQUIRE_VERSION=2.4
5
Maciej Zdebfcdfd852020-11-30 18:27:47 +00006server s1 {
7 rxreq
8 txresp
9} -repeat 4 -start
10
11syslog 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
22haproxy 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
44client 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
59syslog Slg_1 -wait
60
61client c1 -wait