blob: 22414e08aa3b9510a53132f9b361206ecf696558 [file] [log] [blame]
Tim Duesterhus3943e4f2020-09-11 14:25:23 +02001varnishtest "iif converter Test"
Willy Tarreau0f08c372020-09-29 10:51:16 +02002#REQUIRE_VERSION=2.3
Tim Duesterhus3943e4f2020-09-11 14:25:23 +02003
4feature ignore_unknown_macro
5
6server s1 {
7 rxreq
8 txresp
9} -repeat 3 -start
10
11haproxy h1 -conf {
12 defaults
13 mode http
14 timeout connect 1s
15 timeout client 1s
16 timeout server 1s
17
18 frontend fe
19 bind "fd@${fe}"
20
21 #### requests
22 http-request set-var(txn.iif) req.hdr_cnt(count),iif(ok,ko)
23 http-response set-header iif %[var(txn.iif)]
24
25 default_backend be
26
27 backend be
28 server s1 ${s1_addr}:${s1_port}
29} -start
30
31client c1 -connect ${h1_fe_sock} {
32 txreq
33 rxresp
34 expect resp.status == 200
35 expect resp.http.iif == "ko"
36 txreq \
37 -hdr "count: 1"
38 rxresp
39 expect resp.status == 200
40 expect resp.http.iif == "ok"
41 txreq \
42 -hdr "count: 1,2"
43 rxresp
44 expect resp.status == 200
45 expect resp.http.iif == "ok"
46} -run