[master] 5ecae908c stop using "purge" in the context of bans

Nils Goroll nils.goroll at uplex.de
Wed Feb 13 06:56:07 UTC 2019


commit 5ecae908c8cfb9c6d2422d55d1081e5941b8a6e1
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Wed Feb 13 07:52:42 2019 +0100

    stop using "purge" in the context of bans

diff --git a/bin/varnishtest/tests/c00022.vtc b/bin/varnishtest/tests/c00022.vtc
index 79a034fb2..42383a63a 100644
--- a/bin/varnishtest/tests/c00022.vtc
+++ b/bin/varnishtest/tests/c00022.vtc
@@ -20,11 +20,11 @@ server s1 {
 
 varnish v1 -vcl+backend {
 	sub vcl_recv {
-		if (req.method == "PURGE") {
+		if (req.method == "BAN") {
 			ban ("req.url == " + req.url);
 			return (synth(410));
 		}
-		if (req.method == "PURGESTR") {
+		if (req.method == "BANSTR") {
 			ban ("" + req.http.ban);
 			return (synth(410));
 		}
@@ -42,7 +42,7 @@ client c1 {
 
 # Ban: something else
 client c1 {
-	txreq -req PURGE -url /foox
+	txreq -req BAN -url /foox
 	rxresp
 	expect resp.status == 410
 } -run
@@ -59,7 +59,7 @@ client c1 {
 
 # Ban: it
 client c1 {
-	txreq -req PURGE -url /foo
+	txreq -req BAN -url /foo
 	rxresp
 	expect resp.status == 410
 } -run
@@ -76,7 +76,7 @@ client c1 {
 
 # Ban: everything else
 client c1 {
-	txreq -req PURGESTR -hdr "ban: req.url != /foo"
+	txreq -req BANSTR -hdr "ban: req.url != /foo"
 	rxresp
 	expect resp.status == 410
 } -run
@@ -93,7 +93,7 @@ client c1 {
 
 # Ban: it
 client c1 {
-	txreq -req PURGESTR -hdr "Ban: obj.http.foo == bar6"
+	txreq -req BANSTR -hdr "Ban: obj.http.foo == bar6"
 	rxresp
 	expect resp.status == 410
 } -run
@@ -110,7 +110,7 @@ client c1 {
 
 # Ban: something else
 client c1 {
-	txreq -req PURGESTR -hdr "Ban: obj.http.foo == bar6"
+	txreq -req BANSTR -hdr "Ban: obj.http.foo == bar6"
 	rxresp
 	expect resp.status == 410
 } -run
@@ -128,7 +128,7 @@ client c1 {
 
 # Header match
 client c1 {
-	txreq -req PURGESTR -hdr "Ban: req.http.foo == barcheck"
+	txreq -req BANSTR -hdr "Ban: req.http.foo == barcheck"
 	rxresp
 	expect resp.status == 410
 } -run
@@ -144,7 +144,7 @@ client c1 {
 
 # Header match
 client c1 {
-	txreq -req PURGESTR -hdr "Ban: obj.http.foo == barcheck"
+	txreq -req BANSTR -hdr "Ban: obj.http.foo == barcheck"
 	rxresp
 	expect resp.status == 410
 } -run
diff --git a/bin/varnishtest/tests/v00011.vtc b/bin/varnishtest/tests/v00011.vtc
index ea79b6492..9d391d3c0 100644
--- a/bin/varnishtest/tests/v00011.vtc
+++ b/bin/varnishtest/tests/v00011.vtc
@@ -10,7 +10,7 @@ server s1 {
 
 varnish v1 -vcl+backend {
 	sub vcl_recv {
-		if (req.method == "PURGE") {
+		if (req.method == "BAN") {
 			ban(req.http.doesntexist);
 			ban("");
 			ban("req.url");
@@ -43,7 +43,7 @@ logexpect l1 -v v1 -d 1 -g vxid {
 } -start
 
 client c1 {
-	txreq -req "PURGE"
+	txreq -req "BAN"
 	rxresp
 	expect resp.http.X-Varnish == "1004"
 	expect resp.status == 209


More information about the varnish-commit mailing list