blob: 1ff12c7d62128d60b4db118d71c52e2eee101fb2 [file] [log] [blame]
Tim Duesterhus5fcec842020-02-28 15:13:32 +01001varnishtest "unique-id test"
2
3feature ignore_unknown_macro
4
5server s1 {
6 rxreq
7 txresp
8} -repeat 2 -start
9
10haproxy h1 -conf {
11 defaults
12 mode http
13 timeout connect 1s
14 timeout client 1s
15 timeout server 1s
16
17 frontend stable
18 bind "fd@${fe1}"
19 unique-id-format TEST-%[uuid]
20 http-response set-header A %[unique-id]
21 http-response set-header B %[unique-id]
22 default_backend be
23
24 frontend request_data
25 bind "fd@${fe2}"
26 unique-id-format TEST-%[req.hdr(in)]
27 http-response set-header out %[unique-id]
28 default_backend be
29
30 backend be
31 server srv1 ${s1_addr}:${s1_port}
32} -start
33
34client c1 -connect ${h1_fe1_sock} {
35 txreq -url "/"
36 rxresp
37 expect resp.status == 200
38 expect resp.http.a == resp.http.b
39} -run
40
41client c2 -connect ${h1_fe2_sock} {
42 txreq -url "/" \
43 -hdr "in: 12345678"
44 rxresp
45 expect resp.status == 200
46 expect resp.http.out == "TEST-12345678"
47} -run