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