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 |
Christopher Faulet | 8f16148 | 2018-12-19 11:49:39 +0100 | [diff] [blame] | 18 | ${no-htx} option http-use-htx |
PiBa-NL | 0527639 | 2018-11-30 21:01:01 +0100 | [diff] [blame] | 19 | bind "fd@${fe1}" |
| 20 | default_backend b1 |
| 21 | |
| 22 | backend b1 |
| 23 | mode http |
Christopher Faulet | 8f16148 | 2018-12-19 11:49:39 +0100 | [diff] [blame] | 24 | ${no-htx} option http-use-htx |
PiBa-NL | 0527639 | 2018-11-30 21:01:01 +0100 | [diff] [blame] | 25 | http-request use-service lua.fakeserv |
| 26 | |
| 27 | } -start |
| 28 | |
| 29 | client c0 -connect ${h1_fe1_sock} { |
| 30 | txreq -url "/" -hdr "vtcport: ${s1_port}" |
| 31 | rxresp |
| 32 | expect resp.status == 200 |
| 33 | } -run |
| 34 | |
| 35 | |
Willy Tarreau | 6b6736b | 2018-12-07 15:25:26 +0100 | [diff] [blame] | 36 | server s1 -wait |