varnishtest "Check that backend named 'default' is the default"

server s1 {
	rxreq
	txresp -bodylen 25
} -start

server s2 {
	rxreq
	txresp -bodylen 52
} -start

varnish v1 -vcl {
	backend s1 {
		.host = "${s1_addr}";
		.port = "${s1_port}";
	}
	backend default {
		.host = "${s2_addr}";
		.port = "${s2_port}";
	}

	sub vcl_backend_fetch {
		if (bereq.url != bereq.url) {
			set bereq.backend = s1;
		}
	}
} -start

client c1 {
	txreq
	rxresp
	expect resp.bodylen == 52
} -run
