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