blob: 25e238e522eb5e388a11f7ef9fb59cbb19c893f2 [file] [log] [blame]
PiBa-NL05276392018-11-30 21:01:01 +01001varnishtest "Lua: check socket functionality from a lua-task"
2feature ignore_unknown_macro
3
4#REQUIRE_OPTIONS=LUA
5#REQUIRE_VERSION=1.6
6
7server s1 {
8 rxreq
9 txresp -bodylen 20
10} -start
11
12haproxy h1 -conf {
13 global
Frédéric Lécailleb894f922019-03-29 16:13:48 +010014 lua-load ${testdir}/lua_socket.lua
PiBa-NL05276392018-11-30 21:01:01 +010015
16 frontend fe1
17 mode http
Christopher Faulet8f161482018-12-19 11:49:39 +010018 ${no-htx} option http-use-htx
PiBa-NL05276392018-11-30 21:01:01 +010019 bind "fd@${fe1}"
20 default_backend b1
21
22 backend b1
23 mode http
Christopher Faulet8f161482018-12-19 11:49:39 +010024 ${no-htx} option http-use-htx
PiBa-NL05276392018-11-30 21:01:01 +010025 http-request use-service lua.fakeserv
26
27} -start
28
29client c0 -connect ${h1_fe1_sock} {
30 txreq -url "/" -hdr "vtcport: ${s1_port}"
31 rxresp
32 expect resp.status == 200
33} -run
34
35
Willy Tarreau6b6736b2018-12-07 15:25:26 +010036server s1 -wait