2023-07-27 16:43:30 +00:00
|
|
|
varnishtest "Reverse server test"
|
|
|
|
feature ignore_unknown_macro
|
|
|
|
|
2024-03-29 16:12:47 +00:00
|
|
|
feature cmd "$HAPROXY_PROGRAM -cc 'version_atleast(2.9-dev0)'"
|
2023-07-27 16:43:30 +00:00
|
|
|
|
|
|
|
barrier b1 cond 2
|
|
|
|
|
|
|
|
haproxy h_edge -conf {
|
2023-11-30 13:28:47 +00:00
|
|
|
global
|
|
|
|
expose-experimental-directives
|
|
|
|
|
2023-07-27 16:43:30 +00:00
|
|
|
defaults
|
|
|
|
log global
|
|
|
|
timeout connect "${HAPROXY_TEST_TIMEOUT-5s}"
|
|
|
|
timeout client "${HAPROXY_TEST_TIMEOUT-5s}"
|
|
|
|
timeout server "${HAPROXY_TEST_TIMEOUT-5s}"
|
|
|
|
mode http
|
|
|
|
|
|
|
|
frontend pub
|
|
|
|
bind "fd@${pub}"
|
|
|
|
use_backend be-reverse
|
|
|
|
|
|
|
|
backend be-reverse
|
2023-10-20 09:34:46 +00:00
|
|
|
server dev rhttp@
|
2023-07-27 16:43:30 +00:00
|
|
|
|
|
|
|
frontend priv
|
|
|
|
bind "fd@${priv}" proto h2
|
|
|
|
tcp-request session attach-srv be-reverse/dev
|
|
|
|
} -start
|
|
|
|
|
|
|
|
# Run a client through public endpoint
|
|
|
|
# Reverse server has no connection available thus a 503 is expected
|
|
|
|
client c1 -connect ${h_edge_pub_sock} {
|
|
|
|
txreq -url "/"
|
|
|
|
rxresp
|
|
|
|
expect resp.status == 503
|
|
|
|
} -run
|
|
|
|
|
|
|
|
# Run a client through private endpoint
|
|
|
|
# Connection will be attached to the reverse server
|
|
|
|
client c_dev -connect ${h_edge_priv_sock} {
|
|
|
|
txpri
|
|
|
|
|
|
|
|
stream 0 {
|
|
|
|
txsettings
|
|
|
|
rxsettings
|
|
|
|
txsettings -ack
|
|
|
|
rxsettings
|
|
|
|
expect settings.ack == true
|
|
|
|
} -run
|
|
|
|
|
|
|
|
barrier b1 sync
|
|
|
|
stream 1 {
|
|
|
|
rxhdrs
|
|
|
|
} -run
|
|
|
|
|
|
|
|
sendhex "000004 01 05 00000001 88 5c 01 30"
|
|
|
|
} -start
|
|
|
|
|
|
|
|
# Wait for dev client to be ready to process connection
|
|
|
|
barrier b1 sync
|
|
|
|
|
|
|
|
# Run a client through public endpoint
|
|
|
|
# Reverse server should now be able to proceed with the request
|
|
|
|
client c2 -connect ${h_edge_pub_sock} {
|
|
|
|
txreq -url "/"
|
|
|
|
rxresp
|
|
|
|
expect resp.status == 200
|
|
|
|
} -run
|