varnishtest "Simple expiry test (fully reaped object)"

barrier b1 cond 2

server s1 {
	rxreq
	expect req.url == "/"
	txresp -hdr "Cache-control: max-age = 1" -body "1111\n"
	barrier b1 sync
	rxreq
	expect req.url == "/"
	txresp -hdr "Cache-control: max-age = 1" -body "22222\n"
} -start

varnish v1 -vcl+backend { } -start

varnish v1 -cliok "param.set default_keep 0"
varnish v1 -cliok "param.set default_grace 0"

client c1 {
	txreq -url "/"
	rxresp
	expect resp.bodylen == 5
	expect resp.http.x-varnish == "1001"
	expect resp.status == 200
} -run

barrier b1 sync
delay 1.1

client c2 {
	txreq -url "/"
	rxresp
	expect resp.status == 200
	expect resp.http.x-varnish == "1004"
	expect resp.bodylen == 6
} -run
