Commit f5ffd65d authored by Federico G. Schwindt's avatar Federico G. Schwindt

Fail the test if we panic when stopping the child

parent 07d4e752
......@@ -38,4 +38,4 @@ client c1 {
expect_close
} -run
varnish v1 -cliok "panic.show"
varnish v1 -cliok "panic.clear"
......@@ -56,6 +56,8 @@ varnish v1 -cliok "debug.persistent s0 dump"
# Panic worker so second segment does not get closed
varnish v1 -clierr 400 "debug.panic.worker"
varnish v1 -cliok "panic.clear"
delay 0.5
# start again
......
......@@ -24,4 +24,4 @@ client c1 {
expect_close
} -run
varnish v1 -wait-stopped
varnish v1 -cliok "panic.clear"
......@@ -137,8 +137,8 @@ wait_stopped(const struct varnish *v)
char *r = NULL;
enum VCLI_status_e st;
vtc_log(v->vl, 3, "wait-stopped");
while (1) {
vtc_log(v->vl, 3, "wait-stopped");
st = varnish_ask_cli(v, "status", &r);
if (st != CLIS_OK)
vtc_fatal(v->vl,
......@@ -600,26 +600,13 @@ varnish_start(struct varnish *v)
static void
varnish_stop(struct varnish *v)
{
char *r = NULL;
if (v->cli_fd < 0)
varnish_launch(v);
if (vtc_error)
return;
vtc_log(v->vl, 2, "Stop");
(void)varnish_ask_cli(v, "stop", NULL);
while (1) {
(void)varnish_ask_cli(v, "status", &r);
AN(r);
if (!strcmp(r, "Child in state stopped")) {
free(r);
break;
}
free(r);
r = NULL;
(void)sleep (1);
/* XXX: should fail eventually */
}
wait_stopped(v);
}
/**********************************************************************
......@@ -685,6 +672,9 @@ varnish_wait(struct varnish *v)
/* Then stop it */
varnish_stop(v);
if (varnish_ask_cli(v, "panic.clear", NULL) != CLIS_CANT)
vtc_fatal(v->vl, "Unexpected panic");
varnish_cleanup(v);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment