blob: 95383634293dcc9f6e661add134414b7955c133a [file] [log] [blame]
Willy Tarreaucc794b92020-12-02 16:44:34 +01001varnishtest "Lua: txn:get_priv() scope"
2#REQUIRE_OPTIONS=LUA,OPENSSL
3#REQUIRE_VERSION=2.4
4#REGTEST_TYPE=bug
5
6feature ignore_unknown_macro
7
8haproxy h1 -conf {
9 global
Willy Tarreaue1465c12021-05-09 14:41:41 +020010 # 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 Tarreaucc794b92020-12-02 16:44:34 +010015 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 Tarreaucc794b92020-12-02 16:44:34 +010020 bind "fd@${fe1}"
21 default_backend b1
22
23 frontend fe2
24 mode http
Willy Tarreaucc794b92020-12-02 16:44:34 +010025 bind ":8443" ssl crt ${testdir}/common.pem
26 stats enable
27 stats uri /
28
29 backend b1
30 mode http
Willy Tarreaucc794b92020-12-02 16:44:34 +010031 http-request use-service lua.fakeserv
32} -start
33
34client 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
43client 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
52client 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
61client 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