2018-11-30 21:01:01 +01:00
|
|
|
varnishtest "Lua: check socket functionality from a lua-task"
|
|
|
|
feature ignore_unknown_macro
|
|
|
|
|
|
|
|
#REQUIRE_OPTIONS=LUA
|
|
|
|
|
|
|
|
server s1 {
|
|
|
|
rxreq
|
|
|
|
txresp -bodylen 20
|
|
|
|
} -start
|
|
|
|
|
2024-11-19 16:51:30 +01:00
|
|
|
haproxy h1 -conf {
|
2018-11-30 21:01:01 +01:00
|
|
|
global
|
2024-12-20 17:25:29 +01:00
|
|
|
tune.lua.bool-sample-conversion normal
|
2019-03-29 16:13:48 +01:00
|
|
|
lua-load ${testdir}/lua_socket.lua
|
2018-11-30 21:01:01 +01:00
|
|
|
|
2024-11-19 07:43:04 +01:00
|
|
|
defaults
|
|
|
|
timeout client 30s
|
|
|
|
timeout server 30s
|
|
|
|
timeout connect 30s
|
|
|
|
|
2018-11-30 21:01:01 +01:00
|
|
|
frontend fe1
|
|
|
|
mode http
|
|
|
|
bind "fd@${fe1}"
|
|
|
|
default_backend b1
|
|
|
|
|
|
|
|
backend b1
|
|
|
|
mode http
|
|
|
|
http-request use-service lua.fakeserv
|
|
|
|
|
|
|
|
} -start
|
|
|
|
|
|
|
|
client c0 -connect ${h1_fe1_sock} {
|
|
|
|
txreq -url "/" -hdr "vtcport: ${s1_port}"
|
|
|
|
rxresp
|
|
|
|
expect resp.status == 200
|
|
|
|
} -run
|
|
|
|
|
|
|
|
|
2018-12-07 15:25:26 +01:00
|
|
|
server s1 -wait
|