File: tcp_md5_signature.vtc

package info (click to toggle)
haproxy 3.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 24,584 kB
  • sloc: ansic: 275,085; sh: 3,607; xml: 1,756; python: 1,345; makefile: 1,162; perl: 168; cpp: 21
file content (57 lines) | stat: -rw-r--r-- 1,491 bytes parent folder | download
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