vtest "Stevedores RR, beresp.storage"

server s1 -repeat 7 {
	rxreq
	txresp
} -start

vinyl v1 \
    -arg "-ss1=default,1m" \
    -arg "-ss2=default,1m" \
    -arg "-ss0=default,1m" \
    -syntax 4.0 \
    -vcl+backend {
	import vtc;
	sub vcl_backend_response {
		if (bereq.url == "/2") {
			set beresp.storage = storage.s1;
		} else if (bereq.url == "/6") {
			set beresp.storage = vtc.no_stevedore();
		}
		set beresp.http.storage = beresp.storage;
	}
} -start

client c1 {
	txreq -url /1
	rxresp
	expect resp.http.storage == "storage.s1"
	txreq -url /2
	rxresp
	expect resp.http.storage == "storage.s1"
	txreq -url /3
	rxresp
	expect resp.http.storage == "storage.s0"
	txreq -url /4
	rxresp
	expect resp.http.storage == "storage.s1"
	txreq -url /5
	rxresp
	expect resp.http.storage == "storage.s2"
	txreq -url /6
	rxresp
	expect resp.http.storage == <undef>
} -run
