Willy Tarreau | cc794b9 | 2020-12-02 16:44:34 +0100 | [diff] [blame] | 1 | varnishtest "Lua: txn:get_priv() scope" |
| 2 | #REQUIRE_OPTIONS=LUA,OPENSSL |
| 3 | #REQUIRE_VERSION=2.4 |
| 4 | #REGTEST_TYPE=bug |
| 5 | |
| 6 | feature ignore_unknown_macro |
| 7 | |
| 8 | haproxy h1 -conf { |
| 9 | global |
| 10 | lua-load-per-thread ${testdir}/txn_get_priv.lua |
| 11 | lua-load-per-thread ${testdir}/txn_get_priv-print_r.lua |
| 12 | |
| 13 | frontend fe1 |
| 14 | mode http |
| 15 | ${no-htx} option http-use-htx |
| 16 | bind "fd@${fe1}" |
| 17 | default_backend b1 |
| 18 | |
| 19 | frontend fe2 |
| 20 | mode http |
| 21 | ${no-htx} option http-use-htx |
| 22 | bind ":8443" ssl crt ${testdir}/common.pem |
| 23 | stats enable |
| 24 | stats uri / |
| 25 | |
| 26 | backend b1 |
| 27 | mode http |
| 28 | ${no-htx} option http-use-htx |
| 29 | http-request use-service lua.fakeserv |
| 30 | } -start |
| 31 | |
| 32 | client c0 -repeat 4 -connect ${h1_fe1_sock} { |
| 33 | txreq -url "/0" |
| 34 | rxresp |
| 35 | expect resp.status == 200 |
| 36 | txreq -url "/0" |
| 37 | rxresp |
| 38 | expect resp.status == 200 |
| 39 | } -run |
| 40 | |
| 41 | client c1 -repeat 4 -connect ${h1_fe1_sock} { |
| 42 | txreq -url "/1" |
| 43 | rxresp |
| 44 | expect resp.status == 200 |
| 45 | txreq -url "/1" |
| 46 | rxresp |
| 47 | expect resp.status == 200 |
| 48 | } -run |
| 49 | |
| 50 | client c2 -repeat 4 -connect ${h1_fe1_sock} { |
| 51 | txreq -url "/2" |
| 52 | rxresp |
| 53 | expect resp.status == 200 |
| 54 | txreq -url "/2" |
| 55 | rxresp |
| 56 | expect resp.status == 200 |
| 57 | } -run |
| 58 | |
| 59 | client c3 -repeat 4 -connect ${h1_fe1_sock} { |
| 60 | txreq -url "/3" |
| 61 | rxresp |
| 62 | expect resp.status == 200 |
| 63 | txreq -url "/3" |
| 64 | rxresp |
| 65 | expect resp.status == 200 |
| 66 | } -run |
| 67 | |