blob: d209c6e0d673659e65bfb70aac5bb6479d702a23 [file] [log] [blame]
vkill1dfd1652019-10-30 16:58:14 +08001varnishtest "srv_name sample fetche Test"
2
3#REQUIRE_VERSION=2.1
4
5feature ignore_unknown_macro
6
7server s1 {
8 rxreq
9 txresp
10} -start
11
12server s2 {
13 rxreq
14 txresp
15} -start
16
17haproxy h1 -conf {
18 defaults
19 mode http
20 timeout connect 1s
21 timeout client 1s
22 timeout server 1s
23
24 frontend fe
25 bind "fd@${fe}"
26 http-response set-header srv-id "%[srv_id]"
27 http-response set-header srv-name "%[srv_name]"
28 default_backend be
29
30 backend be
31 server srv1 ${s1_addr}:${s1_port}
32 server srv2 ${s2_addr}:${s2_port}
33} -start
34
35client c1 -connect ${h1_fe_sock} {
36 txreq -url "/"
37 rxresp
38 expect resp.status == 200
39 expect resp.http.srv-id == "1"
40 expect resp.http.srv-name == "srv1"
41 txreq -url "/"
42 rxresp
43 expect resp.status == 200
44 expect resp.http.srv-id == "2"
45 expect resp.http.srv-name == "srv2"
46} -run