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

vinyl v1 -vcl+backend { } -start

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

client c1 {
	txreq -url "/"
	rxresp
	expect resp.bodylen == 5
	expect resp.http.X-Vinyl == "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-Vinyl == "1004"
	expect resp.bodylen == 6
} -run
