Christopher Faulet | 4f33760 | 2020-11-17 10:47:35 +0100 | [diff] [blame] | 1 | varnishtest "Filtering test with several filters and random forwarding (via trace filter)" |
| 2 | |
| 3 | #REQUIRE_VERSION=2.4 |
| 4 | #REQUIRE_OPTION=ZLIB|SLZ |
| 5 | #REGTEST_TYPE=slow |
| 6 | |
| 7 | feature ignore_unknown_macro |
| 8 | |
| 9 | barrier b1 cond 2 -cyclic |
| 10 | |
| 11 | server s1 { |
| 12 | rxreq |
| 13 | expect req.url == "/" |
| 14 | expect req.bodylen == 1048576 |
| 15 | expect req.http.accept-encoding == "<undef>" |
| 16 | txresp \ |
| 17 | -hdr "Content-Type: text/plain" \ |
| 18 | -bodylen 1048576 |
| 19 | |
| 20 | rxreq |
| 21 | expect req.url == "/" |
| 22 | txresp \ |
| 23 | -hdr "Content-Length: 0" |
| 24 | recv 36000 |
| 25 | send_n 1000 "0123456789abcdefghijklmnopqrstuvwxyz" |
| 26 | barrier b1 sync |
| 27 | } -start |
| 28 | |
| 29 | haproxy h1 -conf { |
| 30 | defaults |
| 31 | mode http |
| 32 | ${no-htx} option http-use-htx |
| 33 | timeout connect 1s |
| 34 | timeout client 1s |
| 35 | timeout server 1s |
| 36 | |
| 37 | frontend fe1 |
| 38 | bind "fd@${fe1}" |
| 39 | |
| 40 | compression offload |
| 41 | compression algo gzip |
| 42 | |
| 43 | filter trace name "BEFORE" random-forwarding quiet |
| 44 | filter compression |
| 45 | filter trace name "AFTER" random-forwarding quiet |
| 46 | default_backend be1 |
| 47 | |
| 48 | backend be1 |
| 49 | server www ${s1_addr}:${s1_port} |
| 50 | |
| 51 | } -start |
| 52 | |
| 53 | client c1 -connect ${h1_fe1_sock} { |
| 54 | txreq -url "/" \ |
| 55 | -hdr "Accept-Encoding: gzip" \ |
| 56 | -hdr "Content-Type: text/plain" \ |
| 57 | -bodylen 1048576 |
| 58 | rxresp |
| 59 | expect resp.status == 200 |
| 60 | expect resp.http.content-encoding == "gzip" |
| 61 | expect resp.http.transfer-encoding == "chunked" |
| 62 | gunzip |
| 63 | expect resp.bodylen == 1048576 |
| 64 | |
| 65 | txreq -method "CONNECT" -url "/" -nolen |
| 66 | rxresp |
| 67 | expect resp.status == 200 |
| 68 | send_n 1000 "0123456789abcdefghijklmnopqrstuvwxyz" |
| 69 | recv 36000 |
| 70 | barrier b1 sync |
| 71 | } -run |