[master] 1d75f29c7 test polish suggested by Dridi, thank you

Nils Goroll nils.goroll at uplex.de
Wed Jun 10 07:06:07 UTC 2020


commit 1d75f29c7b49219aa6c2ca75917dd5f9ded1afcc
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Wed Jun 10 08:56:08 2020 +0200

    test polish suggested by Dridi, thank you

diff --git a/bin/varnishtest/tests/d00015.vtc b/bin/varnishtest/tests/d00015.vtc
index 371f6bccd..5050cff45 100644
--- a/bin/varnishtest/tests/d00015.vtc
+++ b/bin/varnishtest/tests/d00015.vtc
@@ -22,33 +22,36 @@ varnish v1 -vcl+backend {
 
 		std.log("-- invalid replicas");
 		if (!vd.reconfigure(replicas=0)) {
+			# continue intentionally
 			std.log("reconfigure failed");
 		}
 
 		std.log("-- no changes - no debug output");
 		if (!vd.reconfigure(replicas=25)) {
+			# continue intentionally
 			std.log("reconfigure failed");
 		}
 
 		std.log("-- no backends");
 		if (!vd.clear()) {
-			std.log("clear failed");
+			return(fail("clear failed"));
 		}
 		if (!vd.reconfigure(replicas=25)) {
+			# continue intentionally
 			std.log("reconfigure failed");
 		}
 
 		std.log("-- one backend");
 		if (!vd.add_backend(s1)) {
-			std.log("add s1 failed");
+			return(fail("add s1 failed"));
 		}
 		if (!vd.reconfigure(replicas=1)) {
-			std.log("reconfigure failed");
+			return(fail("reconfigure failed"));
 		}
 
 		std.log("-- no change - no output");
 		if (!vd.reconfigure(replicas=1)) {
-			std.log("reconfigure failed");
+			return(fail("reconfigure failed"));
 		}
 
 		std.log("-- change, clear, no backends");
@@ -60,6 +63,7 @@ varnish v1 -vcl+backend {
 		vd.add_backend(s2);
 		vd.clear();
 		if (!vd.reconfigure()) {
+			# continue intentionally
 			std.log("reconfigure failed");
 		}
 
@@ -69,7 +73,7 @@ varnish v1 -vcl+backend {
 		vd.add_backend(s2);
 		vd.add_backend(s1);
 		if (!vd.reconfigure(replicas=1)) {
-			std.log("reconfigure failed");
+			return(fail("reconfigure failed"));
 		}
 
 		std.log("-- duplicate add with idents");
@@ -82,19 +86,19 @@ varnish v1 -vcl+backend {
 		vd.add_backend(s2, ident="s1_1");
 		vd.add_backend(s2, ident="s1_2");
 		if (!vd.reconfigure(replicas=1)) {
-			std.log("reconfigure failed");
+			return(fail("reconfigure failed"));
 		}
 
 		std.log("-- remove s1_2 specifically");
 		vd.remove_backend(ident="s1_2");
 		if (!vd.reconfigure(replicas=1)) {
-			std.log("reconfigure failed");
+			return(fail("reconfigure failed"));
 		}
 
 		std.log("-- remove all instances of s1");
 		vd.remove_backend(s1);
 		if (!vd.reconfigure(replicas=1)) {
-			std.log("reconfigure failed");
+			return(fail("reconfigure failed"));
 		}
 
 		std.log("-- re-add some - no 2nd director");
@@ -110,19 +114,19 @@ varnish v1 -vcl+backend {
 		vd.add_backend(s3, "8");
 		vd.add_backend(s3, "9");
 		if (!vd.reconfigure(replicas=1)) {
-			std.log("reconfigure failed");
+			return(fail("reconfigure failed"));
 		}
 
 		std.log("-- remove second-last");
 		vd.remove_backend(ident="8");
 		if (!vd.reconfigure(replicas=1)) {
-			std.log("reconfigure failed");
+			return(fail("reconfigure failed"));
 		}
 
 		std.log("-- remove last");
 		vd.remove_backend(ident="9");
 		if (!vd.reconfigure(replicas=1)) {
-			std.log("reconfigure failed");
+			return(fail("reconfigure failed"));
 		}
 
 		std.log("-- END");
@@ -146,7 +150,7 @@ varnish v1 -vcl+backend {
 		vd.add_backend(s1, "0x0e");
 		vd.add_backend(s1, "0x0f");
 		if (!vd.reconfigure(replicas=1)) {
-			std.log("reconfigure failed");
+			return(fail("reconfigure failed"));
 		}
 		vd.remove_backend(s1, "0x00");
 		vd.remove_backend(s1, "0x01");
@@ -165,7 +169,7 @@ varnish v1 -vcl+backend {
 		vd.remove_backend(s1, "0x0e");
 		vd.remove_backend(s1, "0x0f");
 		if (!vd.reconfigure(replicas=1)) {
-			std.log("reconfigure failed");
+			return(fail("reconfigure failed"));
 		}
 		vd.set_warmup(0.5);
 
@@ -180,7 +184,7 @@ varnish v1 -vcl+backend {
 		vd.add_backend(s3, "4");
 		vd.add_backend(s3, "5");
 		if (!vd.reconfigure(replicas=1)) {
-			std.log("reconfigure failed");
+			return(fail("reconfigure failed"));
 		}
 		vd.set_warmup(0);
 	}
diff --git a/bin/varnishtest/tests/d00016.vtc b/bin/varnishtest/tests/d00016.vtc
index b58ea294b..ac0bb7644 100644
--- a/bin/varnishtest/tests/d00016.vtc
+++ b/bin/varnishtest/tests/d00016.vtc
@@ -22,35 +22,39 @@ varnish v1 -vcl+backend {
 	}
 
 	sub vcl_recv {
+
 		std.log("-- invalid replicas");
 		if (!vd.reconfigure(replicas=0)) {
+			# continue intentionally
 			std.log("reconfigure failed");
 		}
 
 		std.log("-- no changes - no debug output");
 		if (!vd.reconfigure(replicas=25)) {
+			# continue intentionally
 			std.log("reconfigure failed");
 		}
 
 		std.log("-- no backends");
 		if (!vd.clear()) {
-			std.log("clear failed");
+			return(fail("clear failed"));
 		}
 		if (!vd.reconfigure(replicas=25)) {
+			# continue intentionally
 			std.log("reconfigure failed");
 		}
 
 		std.log("-- one backend");
 		if (!vd.add_backend(s1)) {
-			std.log("add s1 failed");
+			return(fail("add s1 failed"));
 		}
 		if (!vd.reconfigure(replicas=1)) {
-			std.log("reconfigure failed");
+			return(fail("reconfigure failed"));
 		}
 
 		std.log("-- no change - no output");
 		if (!vd.reconfigure(replicas=1)) {
-			std.log("reconfigure failed");
+			return(fail("reconfigure failed"));
 		}
 
 		std.log("-- change, clear, no backends");
@@ -62,6 +66,7 @@ varnish v1 -vcl+backend {
 		vd.add_backend(s2);
 		vd.clear();
 		if (!vd.reconfigure()) {
+			# continue intentionally
 			std.log("reconfigure failed");
 		}
 
@@ -71,7 +76,7 @@ varnish v1 -vcl+backend {
 		vd.add_backend(s2);
 		vd.add_backend(s1);
 		if (!vd.reconfigure(replicas=1)) {
-			std.log("reconfigure failed");
+			return(fail("reconfigure failed"));
 		}
 
 		std.log("-- duplicate add with idents");
@@ -84,19 +89,19 @@ varnish v1 -vcl+backend {
 		vd.add_backend(s2, ident="s1_1");
 		vd.add_backend(s2, ident="s1_2");
 		if (!vd.reconfigure(replicas=1)) {
-			std.log("reconfigure failed");
+			return(fail("reconfigure failed"));
 		}
 
 		std.log("-- remove s1_2 specifically");
 		vd.remove_backend(ident="s1_2");
 		if (!vd.reconfigure(replicas=1)) {
-			std.log("reconfigure failed");
+			return(fail("reconfigure failed"));
 		}
 
 		std.log("-- remove all instances of s1");
 		vd.remove_backend(s1);
 		if (!vd.reconfigure(replicas=1)) {
-			std.log("reconfigure failed");
+			return(fail("reconfigure failed"));
 		}
 
 		std.log("-- re-add some - no 2nd director");
@@ -112,23 +117,22 @@ varnish v1 -vcl+backend {
 		vd.add_backend(s3, "8");
 		vd.add_backend(s3, "9");
 		if (!vd.reconfigure(replicas=1)) {
-			std.log("reconfigure failed");
+			return(fail("reconfigure failed"));
 		}
 
 		std.log("-- remove second-last");
 		vd.remove_backend(ident="8");
 		if (!vd.reconfigure(replicas=1)) {
-			std.log("reconfigure failed");
+			return(fail("reconfigure failed"));
 		}
 
 		std.log("-- remove last");
 		vd.remove_backend(ident="9");
 		if (!vd.reconfigure(replicas=1)) {
-			std.log("reconfigure failed");
+			return(fail("reconfigure failed"));
 		}
 
 		std.log("-- END");
-
 		set req.backend_hint = vd.backend();
 		return(pass);
 	}
diff --git a/bin/varnishtest/tests/d00017.vtc b/bin/varnishtest/tests/d00017.vtc
index a8f33b143..36793a386 100644
--- a/bin/varnishtest/tests/d00017.vtc
+++ b/bin/varnishtest/tests/d00017.vtc
@@ -31,16 +31,16 @@ varnish v1 -vcl+backend {
 		new vd = directors.shard();
 		vd.debug(3);
 		if (!vd.add_backend(s1)) {
-			std.log("add s1 failed");
+			return(fail("add s1 failed"));
 		}
 		if (!vd.add_backend(s2)) {
-			std.log("add s2 failed");
+			return(fail("add s2 failed"));
 		}
 		if (!vd.add_backend(s3)) {
-			std.log("add s3 failed");
+			return(fail("add s3 failed"));
 		}
 		if (!vd.reconfigure(replicas=25)) {
-			std.log("reconfigure failed");
+			return(fail("reconfigure failed"));
 		}
 	}
 
diff --git a/bin/varnishtest/tests/d00018.vtc b/bin/varnishtest/tests/d00018.vtc
index a3f02e0ae..429bc9014 100644
--- a/bin/varnishtest/tests/d00018.vtc
+++ b/bin/varnishtest/tests/d00018.vtc
@@ -22,16 +22,16 @@ varnish v1 -vcl+backend {
 	sub vcl_init {
 		new vd = directors.shard();
 		if (!vd.add_backend(s1)) {
-			std.log("add s1 failed");
+			return(fail("add s1 failed"));
 		}
 		if (!vd.add_backend(s2)) {
-			std.log("add s2 failed");
+			return(fail("add s2 failed"));
 		}
 		if (!vd.add_backend(s3)) {
-			std.log("add s3 failed");
+			return(fail("add s3 failed"));
 		}
 		if (!vd.reconfigure(replicas=25)) {
-			std.log("reconfigure failed");
+			return(fail("reconfigure failed"));
 		}
 	}
 
diff --git a/bin/varnishtest/tests/d00021.vtc b/bin/varnishtest/tests/d00021.vtc
index 91930c18b..ee85ace22 100644
--- a/bin/varnishtest/tests/d00021.vtc
+++ b/bin/varnishtest/tests/d00021.vtc
@@ -22,32 +22,32 @@ varnish v1 -vcl+backend {
 	sub vcl_init {
 	    new vd = directors.shard();
 	    if (!vd.add_backend(s1)) {
-		std.log("add s1 failed");
+		return(fail("add s1 failed"));
 	    }
 	    if (!vd.add_backend(s2)) {
-		std.log("add s2 failed");
+		return(fail("add s2 failed"));
 	    }
 	    if (!vd.add_backend(s3)) {
-		std.log("add s3 failed");
+		return(fail("add s3 failed"));
 	    }
 	    if (!vd.reconfigure(replicas=25)) {
-		std.log("reconfigure failed");
+		return(fail("reconfigure failed"));
 	    }
 
 	    new l = directors.shard();
 	    new lp = directors.shard_param();
 	    l.associate(lp.use());
 	    if (!l.add_backend(s1)) {
-		std.log("add s1 failed");
+		return(fail("add s1 failed"));
 	    }
 	    if (!l.add_backend(s2)) {
-		std.log("add s2 failed");
+		return(fail("add s2 failed"));
 	    }
 	    if (!l.add_backend(s3)) {
-		std.log("add s3 failed");
+		return(fail("add s3 failed"));
 	    }
 	    if (!l.reconfigure(replicas=25)) {
-		std.log("reconfigure failed");
+		return(fail("reconfigure failed"));
 	    }
 	    new ll = directors.round_robin();
 	    ll.add_backend(l.backend());
diff --git a/bin/varnishtest/tests/d00029.vtc b/bin/varnishtest/tests/d00029.vtc
index 93a1517c1..698f89e21 100644
--- a/bin/varnishtest/tests/d00029.vtc
+++ b/bin/varnishtest/tests/d00029.vtc
@@ -22,16 +22,16 @@ varnish v1 -vcl+backend {
 	sub vcl_init {
 	    new vd = directors.shard();
 	    if (!vd.add_backend(s1)) {
-		std.log("add s1 failed");
+		return(fail("add s1 failed"));
 	    }
 	    if (!vd.add_backend(s2)) {
-		std.log("add s2 failed");
+		return(fail("add s2 failed"));
 	    }
 	    if (!vd.add_backend(s3)) {
-		std.log("add s3 failed");
+		return(fail("add s3 failed"));
 	    }
 	    if (!vd.reconfigure(replicas=25)) {
-		std.log("reconfigure failed");
+		return(fail("reconfigure failed"));
 	    }
 
 	    vd.debug(1);
diff --git a/bin/varnishtest/tests/d00041.vtc b/bin/varnishtest/tests/d00041.vtc
index bd79cfff1..0f7d5b058 100644
--- a/bin/varnishtest/tests/d00041.vtc
+++ b/bin/varnishtest/tests/d00041.vtc
@@ -24,16 +24,16 @@ varnish v1 -vcl+backend {
 		new vd = directors.shard();
 		vd.debug(3);
 		if (!vd.add_backend(s1)) {
-			std.log("add s1 failed");
+			return(fail("add s1 failed"));
 		}
 		if (!vd.add_backend(s2, weight=2)) {
-			std.log("add s2 failed");
+			return(fail("add s2 failed"));
 		}
 		if (!vd.add_backend(s3, weight=3)) {
-			std.log("add s3 failed");
+			return(fail("add s3 failed"));
 		}
 		if (!vd.reconfigure(replicas=25)) {
-			std.log("reconfigure failed");
+			return(fail("reconfigure failed"));
 		}
 	}
 


More information about the varnish-commit mailing list