[master] b93872a9b v68.vtc: refactor bereq.body test

Nils Goroll nils.goroll at uplex.de
Thu Feb 6 19:14:06 UTC 2025


commit b93872a9bd93608604f8d3a90e3d5feea060f5bc
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Thu Feb 6 19:13:50 2025 +0100

    v68.vtc: refactor bereq.body test

diff --git a/bin/varnishtest/tests/v00068.vtc b/bin/varnishtest/tests/v00068.vtc
index 4b54a5ba0..47b01b71c 100644
--- a/bin/varnishtest/tests/v00068.vtc
+++ b/bin/varnishtest/tests/v00068.vtc
@@ -1,13 +1,15 @@
-varnishtest "unset bereq.body with cached req body"
+varnishtest "unset bereq.body tests"
 
 server s1 {
 	rxreq
 	expect req.method == "GET"
+	expect req.url == "/cached"
 	expect req.http.Content-Length == <undef>
 	txresp
 
 	rxreq
 	expect req.method == "GET"
+	expect req.url == "/cached"
 	txresp
 } -start
 
@@ -15,7 +17,9 @@ varnish v1 -vcl+backend {
 	import std;
 
 	sub vcl_recv {
-		std.cache_req_body(2KB);
+		if (req.url == "/cached") {
+			std.cache_req_body(2KB);
+		}
 	}
 	sub vcl_backend_fetch {
 		unset bereq.body;
@@ -23,11 +27,11 @@ varnish v1 -vcl+backend {
 } -start
 
 client c1 {
-	txreq -body "fine"
+	txreq -url "/cached" -body "fine"
 	rxresp
 	expect resp.status == 200
 
-	txreq
+	txreq -url "/cached"
 	rxresp
 	expect resp.status == 200
 } -run


More information about the varnish-commit mailing list