blob: d6a8c00b3bacad4de0328ffdbf908f68495a69d2 [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 Bretoncc9bf2e2020-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
Willy Tarreauf6739232021-11-18 17:46:22 +010030 timeout connect "${HAPROXY_TEST_TIMEOUT-5s}"
31 timeout client "${HAPROXY_TEST_TIMEOUT-5s}"
32 timeout server "${HAPROXY_TEST_TIMEOUT-5s}"
Frédéric Lécaillea3fe1bb2018-11-28 11:36:48 +010033
34 frontend fe
35 bind "fd@${fe}"
36 default_backend test
37
38 backend test
39 http-request cache-use my_cache
40 server www ${s1_addr}:${s1_port}
41 http-response cache-store my_cache
42
43 cache my_cache
44 total-max-size 3
45 max-age 20
46 max-object-size 3072
47} -start
48
49
50client c1 -connect ${h1_fe_sock} {
51 txreq
52 rxresp
53 expect resp.status == 200
54 expect resp.bodylen == 609
55} -repeat 4 -run