2018-11-30 15:01:01 -05: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 10:51:30 -05:00
|
|
|
haproxy h1 -conf {
|
2018-11-30 15:01:01 -05:00
|
|
|
global
|
2025-06-30 12:44:07 -04:00
|
|
|
.if feature(THREAD)
|
|
|
|
|
thread-groups 1
|
|
|
|
|
.endif
|
|
|
|
|
|
2024-12-20 11:25:29 -05:00
|
|
|
tune.lua.bool-sample-conversion normal
|
2019-03-29 11:13:48 -04:00
|
|
|
lua-load ${testdir}/lua_socket.lua
|
2018-11-30 15:01:01 -05:00
|
|
|
|
2024-11-19 01:43:04 -05:00
|
|
|
defaults
|
|
|
|
|
timeout client 30s
|
|
|
|
|
timeout server 30s
|
|
|
|
|
timeout connect 30s
|
|
|
|
|
|
2018-11-30 15:01:01 -05: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 09:25:26 -05:00
|
|
|
server s1 -wait
|