varnishtest "Write a body to a file"

server s1 {
	# First, HTTP checks
	rxreq
	expect req.http.Content-Type == "text/plain"

	# Then, payload checks
	write_body req.txt
	shell {grep -q request req.txt}

	txresp -hdr "Content-Type: text/plain" -body response
} -start

client c1 -connect ${s1_sock} {
	txreq -req POST -hdr "Content-Type: text/plain" -body request

	# First, HTTP checks
	rxresp
	expect resp.http.Content-Type == "text/plain"

	# Then, payload checks
	write_body resp.txt
	shell {grep -q response resp.txt}
} -run
