2018-11-30 20:01:01 +00:00
|
|
|
varnishtest "Lua: check socket functionality from a lua-task"
|
|
|
|
feature ignore_unknown_macro
|
|
|
|
|
|
|
|
#REQUIRE_OPTIONS=LUA
|
|
|
|
#REQUIRE_VERSION=1.6
|
|
|
|
|
|
|
|
server s1 {
|
|
|
|
rxreq
|
|
|
|
txresp -bodylen 20
|
|
|
|
} -start
|
|
|
|
|
|
|
|
haproxy h1 -conf {
|
|
|
|
global
|
2019-03-29 15:13:48 +00:00
|
|
|
lua-load ${testdir}/lua_socket.lua
|
2018-11-30 20:01:01 +00:00
|
|
|
|
|
|
|
frontend fe1
|
|
|
|
mode http
|
2018-12-19 10:49:39 +00:00
|
|
|
${no-htx} option http-use-htx
|
2018-11-30 20:01:01 +00:00
|
|
|
bind "fd@${fe1}"
|
|
|
|
default_backend b1
|
|
|
|
|
|
|
|
backend b1
|
|
|
|
mode http
|
2018-12-19 10:49:39 +00:00
|
|
|
${no-htx} option http-use-htx
|
2018-11-30 20:01:01 +00:00
|
|
|
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
|