vtest "VCL_SUB wrong vmod behavior"

vinyl v1 -arg "-p feature=+no_coredump" -vcl {
	import debug;

	backend dummy None;

	sub foo {
		set resp.http.it = "works";
	}

	sub vcl_init {
		debug.bad_memory(foo);
	}
} -start

vinyl v1 -vcl {
	import debug;
	backend dummy None;

	sub vcl_recv {
		call debug.total_recall();
	}

}

client c1 {
	txreq -url "/foo"
	expect_close
} -run

vinyl v1 -wait-stopped
vinyl v1 -cliexpect "Assert error in VPI_Call_Check" "panic.show"
vinyl v1 -cliok "panic.clear"
vinyl v1 -expect MGT.child_panic == 1
vinyl v1 -expectexit 0x40
