Amaury Denoyelle | d86ae4b | 2021-01-26 14:35:23 +0100 | [diff] [blame] | 1 | varnishtest "Test the http-reuse always mode" |
| 2 | |
| 3 | #REQUIRE_VERSION=2.2 |
| 4 | |
| 5 | feature ignore_unknown_macro |
| 6 | |
| 7 | haproxy h1 -conf { |
| 8 | defaults |
| 9 | mode http |
| 10 | |
| 11 | listen sender |
| 12 | bind "fd@${feS}" |
| 13 | http-reuse always |
| 14 | server srv ${h1_feR_addr}:${h1_feR_port} |
| 15 | |
| 16 | listen receiver |
| 17 | bind "fd@${feR}" |
| 18 | http-request return status 200 |
| 19 | http-after-response set-header http_first_request %[http_first_req] |
| 20 | } -start |
| 21 | |
| 22 | # bootstrap |
| 23 | client c1 -connect ${h1_feS_sock} { |
| 24 | txreq |
| 25 | rxresp |
| 26 | expect resp.http.http_first_request == "1" |
| 27 | } -run |
| 28 | |
| 29 | client c2 -connect ${h1_feS_sock} { |
| 30 | txreq |
| 31 | rxresp |
| 32 | expect resp.http.http_first_request == "0" |
| 33 | |
| 34 | txreq |
| 35 | rxresp |
| 36 | expect resp.http.http_first_request == "0" |
| 37 | } -run |
| 38 | |
| 39 | client c3 -connect ${h1_feS_sock} { |
| 40 | txreq |
| 41 | rxresp |
| 42 | expect resp.http.http_first_request == "0" |
| 43 | } -run |