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 |
| 17 | timeout connect 1s |
| 18 | timeout client 1s |
| 19 | timeout server 1s |
| 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 |
Christopher Faulet | 8f16148 | 2018-12-19 11:49:39 +0100 | [diff] [blame] | 29 | ${no-htx} option http-use-htx |
Willy Tarreau | f490f30 | 2018-11-23 08:36:06 +0100 | [diff] [blame] | 30 | dispatch ${s2_addr}:${s2_port} |
| 31 | } -start |
| 32 | |
| 33 | client c1 -connect ${h1_fe_tcp_sock} { |
| 34 | txreq -url "/" |
| 35 | rxresp |
| 36 | expect resp.status == 200 |
| 37 | } -run |
| 38 | |
| 39 | client c2 -connect ${h1_fe_http_sock} { |
| 40 | txreq -url "/" |
| 41 | rxresp |
| 42 | expect resp.status == 200 |
| 43 | } -run |