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 |
Willy Tarreau | cc794b9 | 2020-12-02 16:44:34 +0100 | [diff] [blame] | 20 | bind "fd@${fe1}" |
| 21 | default_backend b1 |
| 22 | |
| 23 | frontend fe2 |
| 24 | mode http |
Willy Tarreau | cc794b9 | 2020-12-02 16:44:34 +0100 | [diff] [blame] | 25 | bind ":8443" ssl crt ${testdir}/common.pem |
| 26 | stats enable |
| 27 | stats uri / |
| 28 | |
| 29 | backend b1 |
| 30 | mode http |
Willy Tarreau | cc794b9 | 2020-12-02 16:44:34 +0100 | [diff] [blame] | 31 | http-request use-service lua.fakeserv |
| 32 | } -start |
| 33 | |
| 34 | client c0 -repeat 4 -connect ${h1_fe1_sock} { |
| 35 | txreq -url "/0" |
| 36 | rxresp |
| 37 | expect resp.status == 200 |
| 38 | txreq -url "/0" |
| 39 | rxresp |
| 40 | expect resp.status == 200 |
| 41 | } -run |
| 42 | |
| 43 | client c1 -repeat 4 -connect ${h1_fe1_sock} { |
| 44 | txreq -url "/1" |
| 45 | rxresp |
| 46 | expect resp.status == 200 |
| 47 | txreq -url "/1" |
| 48 | rxresp |
| 49 | expect resp.status == 200 |
| 50 | } -run |
| 51 | |
| 52 | client c2 -repeat 4 -connect ${h1_fe1_sock} { |
| 53 | txreq -url "/2" |
| 54 | rxresp |
| 55 | expect resp.status == 200 |
| 56 | txreq -url "/2" |
| 57 | rxresp |
| 58 | expect resp.status == 200 |
| 59 | } -run |
| 60 | |
| 61 | client c3 -repeat 4 -connect ${h1_fe1_sock} { |
| 62 | txreq -url "/3" |
| 63 | rxresp |
| 64 | expect resp.status == 200 |
| 65 | txreq -url "/3" |
| 66 | rxresp |
| 67 | expect resp.status == 200 |
| 68 | } -run |
| 69 | |