blob: 900957ef770d75f5c0624c4891f800685d4ba9ef [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
Willy Tarreauf6739232021-11-18 17:46:22 +010020 timeout connect "${HAPROXY_TEST_TIMEOUT-5s}"
21 timeout client "${HAPROXY_TEST_TIMEOUT-5s}"
22 timeout server "${HAPROXY_TEST_TIMEOUT-5s}"
vkill1dfd1652019-10-30 16:58:14 +080023
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