r2730 - trunk/varnish-cache/bin/varnishtest

phk at projects.linpro.no phk at projects.linpro.no
Tue Jun 17 22:27:31 CEST 2008


Author: phk
Date: 2008-06-17 22:27:31 +0200 (Tue, 17 Jun 2008)
New Revision: 2730

Modified:
   trunk/varnish-cache/bin/varnishtest/t001.vtc
   trunk/varnish-cache/bin/varnishtest/vtc_client.c
   trunk/varnish-cache/bin/varnishtest/vtc_server.c
Log:
Automatically wait for servers and clients during reset pass.



Modified: trunk/varnish-cache/bin/varnishtest/t001.vtc
===================================================================
--- trunk/varnish-cache/bin/varnishtest/t001.vtc	2008-06-17 10:20:29 UTC (rev 2729)
+++ trunk/varnish-cache/bin/varnishtest/t001.vtc	2008-06-17 20:27:31 UTC (rev 2730)
@@ -2,20 +2,6 @@
 #
 # $Id$
 
-varnish v1 -launch
-
-varnish v1 -vcl {
-	backend s1 {
-		.host = "localhost";
-		.port = "9080";
-	}
-	sub vcl_recv {
-		pipe;
-	}
-}
-
-varnish v1 -start
-
 server s1 -repeat 1 {
 	rxreq 
 	txresp \
@@ -25,6 +11,16 @@
 		-body "012345\n"
 }
 
+varnish v1 -launch
+
+varnish v1 -vcl+backend {
+	sub vcl_recv {
+		pipe;
+	}
+}
+
+varnish v1 -start
+
 server s1 -start 
 
 client c1 {
@@ -35,6 +31,6 @@
 
 client c1 -run
 
-server s1 -wait
+# server s1 -wait
 
-varnish v1 -stop
+# varnish v1 -wait

Modified: trunk/varnish-cache/bin/varnishtest/vtc_client.c
===================================================================
--- trunk/varnish-cache/bin/varnishtest/vtc_client.c	2008-06-17 10:20:29 UTC (rev 2729)
+++ trunk/varnish-cache/bin/varnishtest/vtc_client.c	2008-06-17 20:27:31 UTC (rev 2730)
@@ -167,6 +167,8 @@
 		/* Reset and free */
 		VTAILQ_FOREACH_SAFE(c, &clients, list, c2) {
 			VTAILQ_REMOVE(&clients, c, list);
+			if (c->tp != NULL)
+				client_wait(c);
 			FREE_OBJ(c);
 			/* XXX: MEMLEAK */
 		}

Modified: trunk/varnish-cache/bin/varnishtest/vtc_server.c
===================================================================
--- trunk/varnish-cache/bin/varnishtest/vtc_server.c	2008-06-17 10:20:29 UTC (rev 2729)
+++ trunk/varnish-cache/bin/varnishtest/vtc_server.c	2008-06-17 20:27:31 UTC (rev 2730)
@@ -209,6 +209,8 @@
 		/* Reset and free */
 		VTAILQ_FOREACH_SAFE(s, &servers, list, s2) {
 			VTAILQ_REMOVE(&servers, s, list);
+			if (s->sock >= 0) 
+				server_wait(s);
 			FREE_OBJ(s);
 			/* XXX: MEMLEAK */
 		}




More information about the varnish-commit mailing list