Frédéric Lécaille | a3fe1bb | 2018-11-28 11:36:48 +0100 | [diff] [blame] | 1 | varnishtest "Basic cache test" |
| 2 | |
Willy Tarreau | 86ff9c8 | 2018-12-12 15:21:56 +0100 | [diff] [blame] | 3 | #REQUIRE_VERSION=1.9 |
Frédéric Lécaille | a3fe1bb | 2018-11-28 11:36:48 +0100 | [diff] [blame] | 4 | |
| 5 | feature ignore_unknown_macro |
| 6 | |
| 7 | server s1 { |
| 8 | rxreq |
Remi Tricot-Le Breton | 87c2f25 | 2020-11-12 11:14:41 +0100 | [diff] [blame] | 9 | txresp -nolen -hdr "Transfer-Encoding: chunked" \ |
| 10 | -hdr "Cache-Control: max-age=5" |
Frédéric Lécaille | a3fe1bb | 2018-11-28 11:36:48 +0100 | [diff] [blame] | 11 | 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 | |
| 27 | haproxy h1 -conf { |
| 28 | defaults |
| 29 | mode http |
Christopher Faulet | 8f16148 | 2018-12-19 11:49:39 +0100 | [diff] [blame] | 30 | ${no-htx} option http-use-htx |
Frédéric Lécaille | a3fe1bb | 2018-11-28 11:36:48 +0100 | [diff] [blame] | 31 | 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 | |
| 51 | client c1 -connect ${h1_fe_sock} { |
| 52 | txreq |
| 53 | rxresp |
| 54 | expect resp.status == 200 |
| 55 | expect resp.bodylen == 609 |
| 56 | } -repeat 4 -run |