Frédéric Lécaille | a3fe1bb | 2018-11-28 11:36:48 +0100 | [diff] [blame] | 1 | varnishtest "Basic cache test" |
| 2 | |
Frédéric Lécaille | a3fe1bb | 2018-11-28 11:36:48 +0100 | [diff] [blame] | 3 | feature ignore_unknown_macro |
| 4 | |
| 5 | server s1 { |
| 6 | rxreq |
Remi Tricot-Le Breton | cc9bf2e | 2020-11-12 11:14:41 +0100 | [diff] [blame] | 7 | txresp -nolen -hdr "Transfer-Encoding: chunked" \ |
| 8 | -hdr "Cache-Control: max-age=5" |
Frédéric Lécaille | a3fe1bb | 2018-11-28 11:36:48 +0100 | [diff] [blame] | 9 | chunkedlen 1 |
| 10 | chunkedlen 1 |
| 11 | chunkedlen 2 |
| 12 | chunkedlen 3 |
| 13 | chunkedlen 5 |
| 14 | chunkedlen 8 |
| 15 | chunkedlen 13 |
| 16 | chunkedlen 21 |
| 17 | chunkedlen 34 |
| 18 | chunkedlen 55 |
| 19 | chunkedlen 89 |
| 20 | chunkedlen 144 |
| 21 | chunkedlen 233 |
| 22 | chunkedlen 0 |
| 23 | } -start |
| 24 | |
| 25 | haproxy h1 -conf { |
| 26 | defaults |
| 27 | mode http |
Willy Tarreau | f673923 | 2021-11-18 17:46:22 +0100 | [diff] [blame] | 28 | timeout connect "${HAPROXY_TEST_TIMEOUT-5s}" |
| 29 | timeout client "${HAPROXY_TEST_TIMEOUT-5s}" |
| 30 | timeout server "${HAPROXY_TEST_TIMEOUT-5s}" |
Frédéric Lécaille | a3fe1bb | 2018-11-28 11:36:48 +0100 | [diff] [blame] | 31 | |
| 32 | frontend fe |
| 33 | bind "fd@${fe}" |
| 34 | default_backend test |
| 35 | |
| 36 | backend test |
| 37 | http-request cache-use my_cache |
| 38 | server www ${s1_addr}:${s1_port} |
| 39 | http-response cache-store my_cache |
| 40 | |
| 41 | cache my_cache |
| 42 | total-max-size 3 |
| 43 | max-age 20 |
| 44 | max-object-size 3072 |
| 45 | } -start |
| 46 | |
| 47 | |
| 48 | client c1 -connect ${h1_fe_sock} { |
| 49 | txreq |
| 50 | rxresp |
| 51 | expect resp.status == 200 |
| 52 | expect resp.bodylen == 609 |
| 53 | } -repeat 4 -run |