blob: 6710d3196072d8dc85aff8d231b0b227847cbfbd [file] [log] [blame]
Frédéric Lécaille3c4fb952019-01-17 16:15:33 +01001vtest "Basic test for peers protocol over SSL/TLS"
Ilya Shipitsin9ab31382019-04-17 12:19:56 +05002#REQUIRE_OPTIONS=OPENSSL
Frédéric Lécaille3c4fb952019-01-17 16:15:33 +01003feature ignore_unknown_macro
4
5haproxy h1 -arg "-L A" -conf {
6 defaults
7 timeout client 1s
8 timeout connect 1s
9 timeout server 1s
10
11 backend stkt
12 stick-table type string size 10m store server_id,gpc0,conn_cur,conn_rate(50000) peers peers
13
14 peers peers
15 default-server ssl crt ${testdir}/common.pem verify none
16 bind "fd@${A}" ssl crt ${testdir}/common.pem
17 server A
18 server B ${h2_B_addr}:${h2_B_port}
19 server C ${h3_C_addr}:${h3_C_port}
20 server D ${h4_D_addr}:${h4_D_port}
21
22 frontend fe
23 bind "fd@${fe}"
24 tcp-request content track-sc0 url table stkt
25 tcp-request content sc-inc-gpc0(0)
26}
27
28haproxy h2 -arg "-L B" -conf {
29 defaults
30 timeout client 1s
31 timeout connect 1s
32 timeout server 1s
33
34 backend stkt
35 stick-table type string size 10m store server_id,gpc0,conn_cur,conn_rate(50000) peers peers
36
37 peers peers
38 default-server ssl crt ${testdir}/common.pem verify none
39 bind "fd@${B}" ssl crt ${testdir}/common.pem
40 server A ${h1_A_addr}:${h1_A_port}
41 server B
42 server C ${h3_C_addr}:${h3_C_port}
43 server D ${h4_D_addr}:${h4_D_port}
44
45 frontend fe
46 bind "fd@${fe}"
47 http-request track-sc0 url table stkt
48 http-request sc-inc-gpc0(0)
49}
50
51haproxy h3 -arg "-L C" -conf {
52 defaults
53 timeout client 1s
54 timeout connect 1s
55 timeout server 1s
56
57 backend stkt
58 stick-table type string size 10m store server_id,gpc0,conn_cur,conn_rate(50000) peers peers
59
60 peers peers
61 default-server ssl crt ${testdir}/common.pem verify none
62 bind "fd@${C}" ssl crt ${testdir}/common.pem
63 server A ${h1_A_addr}:${h1_A_port}
64 server B ${h2_B_addr}:${h2_B_port}
65 server C
66 server D ${h4_D_addr}:${h4_D_port}
67
68 frontend fe
69 bind "fd@${fe}"
70 http-request track-sc0 url table stkt
71 http-request sc-inc-gpc0(0)
72}
73
74haproxy h4 -arg "-L D" -conf {
75 defaults
76 timeout client 1s
77 timeout connect 1s
78 timeout server 1s
79
80 backend stkt
81 stick-table type string size 10m store server_id,gpc0,conn_cur,conn_rate(50000) peers peers
82
83 peers peers
84 bind "fd@${D}"
85 server A ${h1_A_addr}:${h1_A_port}
86 server B ${h2_B_addr}:${h2_B_port}
87 server C ${h3_C_addr}:${h3_C_port}
88 server D
89
90 frontend fe
91 bind "fd@${fe}"
92 http-request track-sc0 url table stkt
93 http-request sc-inc-gpc0(0)
94}
95
96client c1 -connect ${h1_fe_sock} {
97 txreq -url "c1_client"
98 expect_close
99} -start
100
101client c2 -connect ${h1_fe_sock} {
102 txreq -url "c2_client"
103 expect_close
104} -start
105
106client c3 -connect ${h1_fe_sock} {
107 txreq -url "c3_client"
108 expect_close
109} -start
110
111client c4 -connect ${h1_fe_sock} {
112 txreq -url "c4_client"
113 expect_close
114} -start
115
116haproxy h1 -start
117delay 0.2
118haproxy h2 -start
119delay 0.2
120haproxy h3 -start
121delay 0.2
122haproxy h4 -start
123delay 0.2
124
125client c1 -wait
126client c2 -wait
127client c3 -wait
128client c4 -wait
129
130delay 2
131
132haproxy h1 -cli {
133 send "show table stkt"
134 expect ~ "# table: stkt, type: string, size:1048[0-9]{4}, used:4(\n0x[0-9a-f]*: key=c[1-4]_client use=0 exp=0 server_id=0 gpc0=1 conn_rate\\(50000\\)=1 conn_cur=0){4}"
135}
136
137haproxy h2 -cli {
138 send "show table stkt"
139 expect ~ "# table: stkt, type: string, size:1048[0-9]{4}, used:4(\n0x[0-9a-f]*: key=c[1-4]_client use=0 exp=0 server_id=0 gpc0=1 conn_rate\\(50000\\)=1 conn_cur=0){4}"
140}
141
142haproxy h3 -cli {
143 send "show table stkt"
144 expect ~ "# table: stkt, type: string, size:1048[0-9]{4}, used:4(\n0x[0-9a-f]*: key=c[1-4]_client use=0 exp=0 server_id=0 gpc0=1 conn_rate\\(50000\\)=1 conn_cur=0){4}"
145}
146
147haproxy h4 -cli {
148 send "show table stkt"
149 expect ~ "# table: stkt, type: string, size:1048[0-9]{4}, used:0\n"
150}
151