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 |
| 5 | #REQUIRE_VERSION=1.6 |
| 6 | |
| 7 | server s1 { |
| 8 | rxreq |
| 9 | txresp -bodylen 20 |
| 10 | } -start |
| 11 | |
| 12 | haproxy h1 -conf { |
| 13 | global |
Willy Tarreau | 6b6736b | 2018-12-07 15:25:26 +0100 | [diff] [blame] | 14 | lua-load ${testdir}/h00002.lua |
PiBa-NL | 0527639 | 2018-11-30 21:01:01 +0100 | [diff] [blame] | 15 | |
| 16 | frontend fe1 |
| 17 | mode http |
| 18 | bind "fd@${fe1}" |
| 19 | default_backend b1 |
| 20 | |
| 21 | backend b1 |
| 22 | mode http |
| 23 | http-request use-service lua.fakeserv |
| 24 | |
| 25 | } -start |
| 26 | |
| 27 | client c0 -connect ${h1_fe1_sock} { |
| 28 | txreq -url "/" -hdr "vtcport: ${s1_port}" |
| 29 | rxresp |
| 30 | expect resp.status == 200 |
| 31 | } -run |
| 32 | |
| 33 | |
Willy Tarreau | 6b6736b | 2018-12-07 15:25:26 +0100 | [diff] [blame] | 34 | server s1 -wait |