PiBa-NL | 0527639 | 2018-11-30 21:01:01 +0100 | [diff] [blame] | 1 | varnishtest "Lua: check socket functionality from a lua-task" |
| 2 | feature ignore_unknown_macro |
| 3 | |
| 4 | #REQUIRE_OPTIONS=LUA |
PiBa-NL | 0527639 | 2018-11-30 21:01:01 +0100 | [diff] [blame] | 5 | |
| 6 | server s1 { |
| 7 | rxreq |
| 8 | txresp -bodylen 20 |
| 9 | } -start |
| 10 | |
| 11 | haproxy h1 -conf { |
| 12 | global |
Frédéric Lécaille | b894f92 | 2019-03-29 16:13:48 +0100 | [diff] [blame] | 13 | lua-load ${testdir}/lua_socket.lua |
PiBa-NL | 0527639 | 2018-11-30 21:01:01 +0100 | [diff] [blame] | 14 | |
| 15 | frontend fe1 |
| 16 | mode http |
| 17 | bind "fd@${fe1}" |
| 18 | default_backend b1 |
| 19 | |
| 20 | backend b1 |
| 21 | mode http |
| 22 | http-request use-service lua.fakeserv |
| 23 | |
| 24 | } -start |
| 25 | |
| 26 | client c0 -connect ${h1_fe1_sock} { |
| 27 | txreq -url "/" -hdr "vtcport: ${s1_port}" |
| 28 | rxresp |
| 29 | expect resp.status == 200 |
| 30 | } -run |
| 31 | |
| 32 | |
Willy Tarreau | 6b6736b | 2018-12-07 15:25:26 +0100 | [diff] [blame] | 33 | server s1 -wait |