2019-03-18 13:08:46 +00:00
|
|
|
vtest "Basic test for peers protocol over SSL/TLS with stick-table declared in peers sections"
|
|
|
|
feature ignore_unknown_macro
|
|
|
|
|
2019-05-07 05:53:54 +00:00
|
|
|
#REQUIRE_OPTIONS=OPENSSL
|
2019-05-07 09:11:00 +00:00
|
|
|
#REGTEST_TYPE=slow
|
2019-05-07 05:53:54 +00:00
|
|
|
|
2019-03-18 13:08:46 +00:00
|
|
|
haproxy h1 -arg "-L A" -conf {
|
|
|
|
defaults
|
2021-11-18 16:46:22 +00:00
|
|
|
timeout client "${HAPROXY_TEST_TIMEOUT-5s}"
|
|
|
|
timeout connect "${HAPROXY_TEST_TIMEOUT-5s}"
|
|
|
|
timeout server "${HAPROXY_TEST_TIMEOUT-5s}"
|
2019-03-18 13:08:46 +00:00
|
|
|
|
|
|
|
peers peers
|
|
|
|
table stkt type string size 10m store server_id,gpc0,conn_cur,conn_rate(50000)
|
|
|
|
default-server ssl crt ${testdir}/common.pem verify none
|
|
|
|
bind "fd@${A}" ssl crt ${testdir}/common.pem
|
|
|
|
server A
|
|
|
|
server B ${h2_B_addr}:${h2_B_port}
|
|
|
|
server C ${h3_C_addr}:${h3_C_port}
|
|
|
|
server D ${h4_D_addr}:${h4_D_port}
|
|
|
|
|
|
|
|
frontend fe
|
|
|
|
bind "fd@${fe}"
|
2019-10-14 14:10:52 +00:00
|
|
|
tcp-request inspect-delay 100ms
|
2019-03-18 13:08:46 +00:00
|
|
|
tcp-request content track-sc0 url table peers/stkt
|
|
|
|
tcp-request content sc-inc-gpc0(0)
|
|
|
|
}
|
|
|
|
|
|
|
|
haproxy h2 -arg "-L B" -conf {
|
|
|
|
defaults
|
2019-10-14 14:10:52 +00:00
|
|
|
mode http
|
2021-11-18 16:46:22 +00:00
|
|
|
timeout client "${HAPROXY_TEST_TIMEOUT-5s}"
|
|
|
|
timeout connect "${HAPROXY_TEST_TIMEOUT-5s}"
|
|
|
|
timeout server "${HAPROXY_TEST_TIMEOUT-5s}"
|
2019-03-18 13:08:46 +00:00
|
|
|
|
|
|
|
peers peers
|
|
|
|
table stkt type string size 10m store server_id,gpc0,conn_cur,conn_rate(50000)
|
|
|
|
default-server ssl crt ${testdir}/common.pem verify none
|
|
|
|
bind "fd@${B}" ssl crt ${testdir}/common.pem
|
|
|
|
server A ${h1_A_addr}:${h1_A_port}
|
|
|
|
server B
|
|
|
|
server C ${h3_C_addr}:${h3_C_port}
|
|
|
|
server D ${h4_D_addr}:${h4_D_port}
|
|
|
|
|
|
|
|
frontend fe
|
|
|
|
bind "fd@${fe}"
|
|
|
|
http-request track-sc0 url table peers/stkt
|
|
|
|
http-request sc-inc-gpc0(0)
|
|
|
|
}
|
|
|
|
|
|
|
|
haproxy h3 -arg "-L C" -conf {
|
|
|
|
defaults
|
2019-10-14 14:10:52 +00:00
|
|
|
mode http
|
2021-11-18 16:46:22 +00:00
|
|
|
timeout client "${HAPROXY_TEST_TIMEOUT-5s}"
|
|
|
|
timeout connect "${HAPROXY_TEST_TIMEOUT-5s}"
|
|
|
|
timeout server "${HAPROXY_TEST_TIMEOUT-5s}"
|
2019-03-18 13:08:46 +00:00
|
|
|
|
|
|
|
peers peers
|
|
|
|
table stkt type string size 10m store server_id,gpc0,conn_cur,conn_rate(50000)
|
|
|
|
default-server ssl crt ${testdir}/common.pem verify none
|
|
|
|
bind "fd@${C}" ssl crt ${testdir}/common.pem
|
|
|
|
server A ${h1_A_addr}:${h1_A_port}
|
|
|
|
server B ${h2_B_addr}:${h2_B_port}
|
|
|
|
server C
|
|
|
|
server D ${h4_D_addr}:${h4_D_port}
|
|
|
|
|
|
|
|
frontend fe
|
|
|
|
bind "fd@${fe}"
|
|
|
|
http-request track-sc0 url table peers/stkt
|
|
|
|
http-request sc-inc-gpc0(0)
|
|
|
|
}
|
|
|
|
|
|
|
|
haproxy h4 -arg "-L D" -conf {
|
|
|
|
defaults
|
2019-10-14 14:10:52 +00:00
|
|
|
mode http
|
2021-11-18 16:46:22 +00:00
|
|
|
timeout client "${HAPROXY_TEST_TIMEOUT-5s}"
|
|
|
|
timeout connect "${HAPROXY_TEST_TIMEOUT-5s}"
|
|
|
|
timeout server "${HAPROXY_TEST_TIMEOUT-5s}"
|
2019-03-18 13:08:46 +00:00
|
|
|
|
|
|
|
backend stkt
|
|
|
|
|
|
|
|
peers peers
|
|
|
|
table stkt type string size 10m store server_id,gpc0,conn_cur,conn_rate(50000)
|
|
|
|
bind "fd@${D}"
|
|
|
|
server A ${h1_A_addr}:${h1_A_port}
|
|
|
|
server B ${h2_B_addr}:${h2_B_port}
|
|
|
|
server C ${h3_C_addr}:${h3_C_port}
|
|
|
|
server D
|
|
|
|
|
|
|
|
frontend fe
|
|
|
|
bind "fd@${fe}"
|
|
|
|
http-request track-sc0 url table peers/stkt
|
|
|
|
http-request sc-inc-gpc0(0)
|
|
|
|
}
|
|
|
|
|
|
|
|
client c1 -connect ${h1_fe_sock} {
|
2019-10-14 14:10:52 +00:00
|
|
|
txreq -url "/c1_client"
|
2019-03-18 13:08:46 +00:00
|
|
|
expect_close
|
|
|
|
} -start
|
|
|
|
|
|
|
|
client c2 -connect ${h1_fe_sock} {
|
2019-10-14 14:10:52 +00:00
|
|
|
txreq -url "/c2_client"
|
2019-03-18 13:08:46 +00:00
|
|
|
expect_close
|
|
|
|
} -start
|
|
|
|
|
|
|
|
client c3 -connect ${h1_fe_sock} {
|
2019-10-14 14:10:52 +00:00
|
|
|
txreq -url "/c3_client"
|
2019-03-18 13:08:46 +00:00
|
|
|
expect_close
|
|
|
|
} -start
|
|
|
|
|
|
|
|
client c4 -connect ${h1_fe_sock} {
|
2019-10-14 14:10:52 +00:00
|
|
|
txreq -url "/c4_client"
|
2019-03-18 13:08:46 +00:00
|
|
|
expect_close
|
|
|
|
} -start
|
|
|
|
|
|
|
|
haproxy h1 -start
|
2022-02-16 10:28:09 +00:00
|
|
|
delay 0.02
|
2019-03-18 13:08:46 +00:00
|
|
|
haproxy h2 -start
|
2022-02-16 10:28:09 +00:00
|
|
|
delay 0.02
|
2019-03-18 13:08:46 +00:00
|
|
|
haproxy h3 -start
|
2022-02-16 10:28:09 +00:00
|
|
|
delay 0.02
|
2019-03-18 13:08:46 +00:00
|
|
|
haproxy h4 -start
|
2022-02-16 10:28:09 +00:00
|
|
|
delay 0.02
|
2019-03-18 13:08:46 +00:00
|
|
|
|
|
|
|
client c1 -wait
|
|
|
|
client c2 -wait
|
|
|
|
client c3 -wait
|
|
|
|
client c4 -wait
|
|
|
|
|
2022-02-16 10:28:09 +00:00
|
|
|
delay 3
|
2019-03-18 13:08:46 +00:00
|
|
|
|
|
|
|
haproxy h1 -cli {
|
|
|
|
send "show table peers/stkt"
|
2022-11-29 15:29:12 +00:00
|
|
|
expect ~ "# table: peers/stkt, type: string, size:1048[0-9]{4}, used:4(\n0x[0-9a-f]*: key=/c[1-4]_client use=0 exp=0 shard=0 server_id=0 gpc0=1 conn_rate\\(50000\\)=1 conn_cur=0){4}"
|
2019-03-18 13:08:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
haproxy h2 -cli {
|
|
|
|
send "show table peers/stkt"
|
2022-11-29 15:29:12 +00:00
|
|
|
expect ~ "# table: peers/stkt, type: string, size:1048[0-9]{4}, used:4(\n0x[0-9a-f]*: key=/c[1-4]_client use=0 exp=0 shard=0 server_id=0 gpc0=1 conn_rate\\(50000\\)=1 conn_cur=0){4}"
|
2019-03-18 13:08:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
haproxy h3 -cli {
|
|
|
|
send "show table peers/stkt"
|
2022-11-29 15:29:12 +00:00
|
|
|
expect ~ "# table: peers/stkt, type: string, size:1048[0-9]{4}, used:4(\n0x[0-9a-f]*: key=/c[1-4]_client use=0 exp=0 shard=0 server_id=0 gpc0=1 conn_rate\\(50000\\)=1 conn_cur=0){4}"
|
2019-03-18 13:08:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
haproxy h4 -cli {
|
|
|
|
send "show table peers/stkt"
|
|
|
|
expect ~ "# table: peers/stkt, type: string, size:1048[0-9]{4}, used:0\n"
|
|
|
|
}
|
|
|
|
|