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