blob: 8696b506ebe67a16318210902713c42a35a0ed6d [file] [log] [blame]
Willy Tarreauf490f302018-11-23 08:36:06 +01001varnishtest "Validate proper operation of the 'dispatch' mode"
2feature ignore_unknown_macro
3
4server s1 {
5 rxreq
6 txresp
7} -start
8
9server s2 {
10 rxreq
11 txresp
12} -start
13
14haproxy h1 -conf {
15defaults
16 log global
Willy Tarreauf6739232021-11-18 17:46:22 +010017 timeout connect "${HAPROXY_TEST_TIMEOUT-5s}"
18 timeout client "${HAPROXY_TEST_TIMEOUT-5s}"
19 timeout server "${HAPROXY_TEST_TIMEOUT-5s}"
Willy Tarreauf490f302018-11-23 08:36:06 +010020
21listen fe_tcp
22 bind "fd@${fe_tcp}"
23 mode tcp
24 dispatch ${s1_addr}:${s1_port}
25
26listen fe_http
27 bind "fd@${fe_http}"
28 mode http
Willy Tarreauf490f302018-11-23 08:36:06 +010029 dispatch ${s2_addr}:${s2_port}
30} -start
31
32client c1 -connect ${h1_fe_tcp_sock} {
33 txreq -url "/"
34 rxresp
35 expect resp.status == 200
36} -run
37
38client c2 -connect ${h1_fe_http_sock} {
39 txreq -url "/"
40 rxresp
41 expect resp.status == 200
42} -run