blob: 849057d9e55f3b187736e007259603029e27dcc9 [file] [log] [blame]
Frédéric Lécaillea3fe1bb2018-11-28 11:36:48 +01001varnishtest "Basic cache test"
2
Willy Tarreau86ff9c82018-12-12 15:21:56 +01003#REQUIRE_VERSION=1.9
Frédéric Lécaillea3fe1bb2018-11-28 11:36:48 +01004
5feature ignore_unknown_macro
6
7server s1 {
8 rxreq
Remi Tricot-Le Breton87c2f252020-11-12 11:14:41 +01009 txresp -nolen -hdr "Transfer-Encoding: chunked" \
10 -hdr "Cache-Control: max-age=5"
Frédéric Lécaillea3fe1bb2018-11-28 11:36:48 +010011 chunkedlen 1
12 chunkedlen 1
13 chunkedlen 2
14 chunkedlen 3
15 chunkedlen 5
16 chunkedlen 8
17 chunkedlen 13
18 chunkedlen 21
19 chunkedlen 34
20 chunkedlen 55
21 chunkedlen 89
22 chunkedlen 144
23 chunkedlen 233
24 chunkedlen 0
25} -start
26
27haproxy h1 -conf {
28 defaults
29 mode http
Christopher Faulet8f161482018-12-19 11:49:39 +010030 ${no-htx} option http-use-htx
Frédéric Lécaillea3fe1bb2018-11-28 11:36:48 +010031 timeout connect 1s
32 timeout client 1s
33 timeout server 1s
34
35 frontend fe
36 bind "fd@${fe}"
37 default_backend test
38
39 backend test
40 http-request cache-use my_cache
41 server www ${s1_addr}:${s1_port}
42 http-response cache-store my_cache
43
44 cache my_cache
45 total-max-size 3
46 max-age 20
47 max-object-size 3072
48} -start
49
50
51client c1 -connect ${h1_fe_sock} {
52 txreq
53 rxresp
54 expect resp.status == 200
55 expect resp.bodylen == 609
56} -repeat 4 -run