2018-11-30 20:01:01 +00: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 15:51:30 +00:00
|
|
|
haproxy h1 -conf {
|
2018-11-30 20:01:01 +00:00
|
|
|
global
|
2019-03-29 15:13:48 +00:00
|
|
|
lua-load ${testdir}/lua_socket.lua
|
2018-11-30 20:01:01 +00:00
|
|
|
|
2024-11-19 06:43:04 +00:00
|
|
|
defaults
|
|
|
|
timeout client 30s
|
|
|
|
timeout server 30s
|
|
|
|
timeout connect 30s
|
|
|
|
|
2018-11-30 20:01:01 +00: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 14:25:26 +00:00
|
|
|
server s1 -wait
|