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 | cc9bf2e | 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 |
Willy Tarreau | f673923 | 2021-11-18 17:46:22 +0100 | [diff] [blame] | 30 | timeout connect "${HAPROXY_TEST_TIMEOUT-5s}" |
| 31 | timeout client "${HAPROXY_TEST_TIMEOUT-5s}" |
| 32 | timeout server "${HAPROXY_TEST_TIMEOUT-5s}" |
Frédéric Lécaille | a3fe1bb | 2018-11-28 11:36:48 +0100 | [diff] [blame] | 33 | |
| 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 | |
| 50 | client c1 -connect ${h1_fe_sock} { |
| 51 | txreq |
| 52 | rxresp |
| 53 | expect resp.status == 200 |
| 54 | expect resp.bodylen == 609 |
| 55 | } -repeat 4 -run |