]> err.no Git - varnish/commitdiff
Actually wait for the varnish child to stop in "varnish -stop".
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Fri, 1 Aug 2008 09:50:28 +0000 (09:50 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Fri, 1 Aug 2008 09:50:28 +0000 (09:50 +0000)
Update test-case

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3055 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishtest/tests/b00004.vtc
varnish-cache/bin/varnishtest/vtc_varnish.c

index 5817b5af5040f2e5e7e88390845e6655e82f60b3..0839fddd963f6d8a7ee3f52dc66f659a32daaa36 100644 (file)
@@ -8,6 +8,15 @@ server s1 {
 
 varnish v1 -vcl+backend { } 
 
+varnish v1 -start
+varnish v1 -stop
+
+varnish v1 -start
+varnish v1 -stop
+
+varnish v1 -start
+varnish v1 -stop
+
 varnish v1 -cliok start
 varnish v1 -clierr 300 start
 varnish v1 -clierr 300 start
@@ -16,13 +25,4 @@ varnish v1 -cliok stop
 varnish v1 -clierr 300 stop
 varnish v1 -clierr 300 stop
 
-varnish v1 -cliok start
-varnish v1 -cliok stop
-
-varnish v1 -cliok start
-varnish v1 -cliok stop
-
-varnish v1 -cliok start
-varnish v1 -cliok stop
-
 varnish v1 -wait
index bd7fccca400b8f42067b34064e5388147c835720..f6fcfcff7cf459b5c209cf5acf1cb2783f3b5ab9 100644 (file)
@@ -268,11 +268,19 @@ varnish_start(struct varnish *v)
 static void
 varnish_stop(struct varnish *v)
 {
+       char *r;
 
        if (v->cli_fd < 0)
                varnish_launch(v);
        vtc_log(v->vl, 2, "Stop");
        (void)varnish_ask_cli(v, "stop", NULL);
+       while (1) {
+               (void)varnish_ask_cli(v, "status", &r);
+               if (!strcmp(r, "Child in state stopped"))
+                       break;
+               free(r);
+               sleep (1);
+       }
 }
 
 /**********************************************************************