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 |
Willy Tarreau | e1465c1 | 2021-05-09 14:41:41 +0200 | [diff] [blame] | 10 | # WT: limit false-positives causing "HTTP header incomplete" due to |
| 11 | # idle server connections being randomly used and randomly expiring |
| 12 | # under us. |
| 13 | tune.idle-pool.shared off |
| 14 | |
Willy Tarreau | cc794b9 | 2020-12-02 16:44:34 +0100 | [diff] [blame] | 15 | lua-load-per-thread ${testdir}/txn_get_priv.lua |
| 16 | lua-load-per-thread ${testdir}/txn_get_priv-print_r.lua |
| 17 | |
| 18 | frontend fe1 |
| 19 | mode http |
| 20 | ${no-htx} option http-use-htx |
| 21 | bind "fd@${fe1}" |
| 22 | default_backend b1 |
| 23 | |
| 24 | frontend fe2 |
| 25 | mode http |
| 26 | ${no-htx} option http-use-htx |
| 27 | bind ":8443" ssl crt ${testdir}/common.pem |
| 28 | stats enable |
| 29 | stats uri / |
| 30 | |
| 31 | backend b1 |
| 32 | mode http |
| 33 | ${no-htx} option http-use-htx |
| 34 | http-request use-service lua.fakeserv |
| 35 | } -start |
| 36 | |
| 37 | client c0 -repeat 4 -connect ${h1_fe1_sock} { |
| 38 | txreq -url "/0" |
| 39 | rxresp |
| 40 | expect resp.status == 200 |
| 41 | txreq -url "/0" |
| 42 | rxresp |
| 43 | expect resp.status == 200 |
| 44 | } -run |
| 45 | |
| 46 | client c1 -repeat 4 -connect ${h1_fe1_sock} { |
| 47 | txreq -url "/1" |
| 48 | rxresp |
| 49 | expect resp.status == 200 |
| 50 | txreq -url "/1" |
| 51 | rxresp |
| 52 | expect resp.status == 200 |
| 53 | } -run |
| 54 | |
| 55 | client c2 -repeat 4 -connect ${h1_fe1_sock} { |
| 56 | txreq -url "/2" |
| 57 | rxresp |
| 58 | expect resp.status == 200 |
| 59 | txreq -url "/2" |
| 60 | rxresp |
| 61 | expect resp.status == 200 |
| 62 | } -run |
| 63 | |
| 64 | client c3 -repeat 4 -connect ${h1_fe1_sock} { |
| 65 | txreq -url "/3" |
| 66 | rxresp |
| 67 | expect resp.status == 200 |
| 68 | txreq -url "/3" |
| 69 | rxresp |
| 70 | expect resp.status == 200 |
| 71 | } -run |
| 72 | |