1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
|
varnishtest "Test the support for tcp-md5sig option (linux only)"
feature cmd "$HAPROXY_PROGRAM -cc 'feature(HAVE_TCP_MD5SIG)'"
feature ignore_unknown_macro
haproxy h1 -conf {
defaults
mode http
timeout client "${HAPROXY_TEST_TIMEOUT-5s}"
timeout server "${HAPROXY_TEST_TIMEOUT-5s}"
timeout connect "${HAPROXY_TEST_TIMEOUT-100ms}"
retries 0
log global
listen internal
bind "fd@${md5_int}" tcp-md5sig mypass
bind "fd@${nomd5_int}"
http-request return status 200
listen fe
bind "fd@${fe}"
use-server s1 if { path /s1 }
use-server s2 if { path /s2 }
use-server s3 if { path /s3 }
use-server s4 if { path /s4 }
server s1 ${h1_md5_int_addr}:${h1_md5_int_port} tcp-md5sig mypass
server s2 ${h1_md5_int_addr}:${h1_md5_int_port} tcp-md5sig badpass
server s3 ${h1_nomd5_int_addr}:${h1_nomd5_int_port}
server s4 ${h1_nomd5_int_addr}:${h1_nomd5_int_port} tcp-md5sig mypass
} -start
client c1 -connect ${h1_fe_sock} {
txreq -req "GET" -url "/s1"
rxresp
expect resp.status == 200
} -run
client c2 -connect ${h1_fe_sock} {
txreq -req "GET" -url "/s2"
rxresp
expect resp.status == 503
} -run
client c3 -connect ${h1_fe_sock} {
txreq -req "GET" -url "/s3"
rxresp
expect resp.status == 200
} -run
client c4 -connect ${h1_fe_sock} {
txreq -req "GET" -url "/s4"
rxresp
expect resp.status == 503
} -run
|