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