r3055 - in trunk/varnish-cache/bin/varnishtest: . tests
phk at projects.linpro.no
phk at projects.linpro.no
Fri Aug 1 11:50:28 CEST 2008
Author: phk
Date: 2008-08-01 11:50:28 +0200 (Fri, 01 Aug 2008)
New Revision: 3055
Modified:
trunk/varnish-cache/bin/varnishtest/tests/b00004.vtc
trunk/varnish-cache/bin/varnishtest/vtc_varnish.c
Log:
Actually wait for the varnish child to stop in "varnish -stop".
Update test-case
Modified: trunk/varnish-cache/bin/varnishtest/tests/b00004.vtc
===================================================================
--- trunk/varnish-cache/bin/varnishtest/tests/b00004.vtc 2008-08-01 09:24:08 UTC (rev 3054)
+++ trunk/varnish-cache/bin/varnishtest/tests/b00004.vtc 2008-08-01 09:50:28 UTC (rev 3055)
@@ -8,6 +8,15 @@
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 -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
Modified: trunk/varnish-cache/bin/varnishtest/vtc_varnish.c
===================================================================
--- trunk/varnish-cache/bin/varnishtest/vtc_varnish.c 2008-08-01 09:24:08 UTC (rev 3054)
+++ trunk/varnish-cache/bin/varnishtest/vtc_varnish.c 2008-08-01 09:50:28 UTC (rev 3055)
@@ -268,11 +268,19 @@
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);
+ }
}
/**********************************************************************
More information about the varnish-commit
mailing list