vtest "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

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

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

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

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

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


barrier b2 sync

client c1 -wait
