varnishtest "Test Basic persistence"

feature persistent_storage

server s1 {
	rxreq
	txresp
	accept
	rxreq
	txresp -status 700
} -start

shell "rm -f ${tmpdir}/_.per"

varnish v1 \
	-arg "-pfeature=+wait_silo" \
	-arg "-sdeprecated_persistent,${tmpdir}/_.per,5m" \
	-vcl+backend { } -start

varnish v1 -stop

varnish v1 -start

client c1 {
	txreq -url "/"
	rxresp
	expect resp.status == 200
	expect resp.http.X-Varnish == "1001"
} -run

varnish v1 -cliok "storage.list"
varnish v1 -cliok "debug.persistent s0 dump"
varnish v1 -cliok "debug.persistent s0 sync"
varnish v1 -stop

varnish v1 -start
varnish v1 -cliok "debug.xid 1999"

client c1 {
	txreq -url "/"
	rxresp
	expect resp.status == 200
	expect resp.http.X-Varnish == "2001 1002"
} -run

# shell "rm -f /tmp/__v1/_.per"
