[master] 2b0c4db Add a test-case to check the master process signal handling

Poul-Henning Kamp phk at FreeBSD.org
Tue Mar 3 12:53:13 CET 2015


commit 2b0c4db89717f18e340617f2bc11221d29bbe449
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Tue Mar 3 11:52:51 2015 +0000

    Add a test-case to check the master process signal handling

diff --git a/bin/varnishtest/tests/b00044.vtc b/bin/varnishtest/tests/b00044.vtc
new file mode 100644
index 0000000..5d02319
--- /dev/null
+++ b/bin/varnishtest/tests/b00044.vtc
@@ -0,0 +1,17 @@
+varnishtest "Test/coverage of varnish master signal handling"
+
+server s1 {
+	rxreq
+	txresp
+} -start
+
+varnish v1 -vcl+backend { } -start
+
+client c1 {
+	txreq
+	rxresp
+} -run
+
+server s1 -wait
+
+shell "kill -15 ${v1_pid}"
diff --git a/bin/varnishtest/vtc_varnish.c b/bin/varnishtest/vtc_varnish.c
index fbe59f8..9ec7683 100644
--- a/bin/varnishtest/vtc_varnish.c
+++ b/bin/varnishtest/vtc_varnish.c
@@ -384,7 +384,7 @@ varnish_launch(struct varnish *v)
 	vsb = VSB_new_auto();
 	AN(vsb);
 	VSB_printf(vsb, "cd ${pwd} &&");
-	VSB_printf(vsb, " ${varnishd} -d -d -n %s", v->workdir);
+	VSB_printf(vsb, "exec ${varnishd} -d -d -n %s", v->workdir);
 	VSB_printf(vsb, " -l 2m,1m,-");
 	VSB_printf(vsb, " -p auto_restart=off");
 	VSB_printf(vsb, " -p syslog_cli_traffic=off");
@@ -420,6 +420,7 @@ varnish_launch(struct varnish *v)
 		exit(1);
 	} else {
 		vtc_log(v->vl, 3, "PID: %ld", (long)v->pid);
+		macro_def(v->vl, v->name, "pid", "%ld", (long)v->pid);
 	}
 	AZ(close(v->fds[0]));
 	AZ(close(v->fds[3]));
@@ -462,7 +463,6 @@ varnish_launch(struct varnish *v)
 	vtc_log(v->vl, 3, "CLI connection fd = %d", v->cli_fd);
 	assert(v->cli_fd >= 0);
 
-
 	/* Receive the banner or auth response */
 	u = varnish_ask_cli(v, NULL, &r);
 	if (vtc_error)



More information about the varnish-commit mailing list