varnishtest "Make sure banlurker skips busy objects"

barrier b1 cond 2
barrier b2 cond 2

server s1 {
	rxreq
	send "HTTP/1.0 200 OK\r\n"
	barrier b1 sync
	send "Foobar: blaf\r\n"
	send "Content-Length: 10\r\n"
	send "\r\n\r\n"
	send "abcde"
	barrier b2 sync
	send "abcdefghij"
} -start

varnish v1 -vcl+backend {
	sub vcl_backend_response {
		set beresp.do_stream = false;
	}
} -start

varnish v1 -cliok {param.set debug +lurker}
varnish v1 -cliok {param.set ban_lurker_age 1}
varnish v1 -cliok {ban.list}

client c1 {
	txreq
	rxresp
	expect resp.status == 200
	expect resp.http.foobar == blaf
} -start

barrier b1 sync
varnish v1 -cliok {ban.list}

varnish v1 -cliok {ban obj.http.goo == bar}
varnish v1 -cliok {ban.list}
delay 2
varnish v1 -cliok {ban.list}


barrier b2 sync

client c1 -wait
