varnishtest "Check Pid file locking"

server s1 {
	rxreq
	txresp
} -start

varnish v1 -vcl+backend {} -start

client c1 {
	txreq
	rxresp
} -run

delay .2

shell -err -expect {Error: Could not open pid-file} {
	varnishd -P /dev/tty -b None -a :0 -n ${tmpdir}
}

shell -err -expect {Error: Varnishd is already running} {
	varnishd -P ${v1_name}/varnishd.pid -b None -a :0 -n ${tmpdir}
}

shell -err -expect {Error: Varnishd is already running} {
	varnishd -b None -a:0 -n ${tmpdir}/v1 -F
}
