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