Commit 85ea8cda authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Define a macro for "bad_ip", an IP number we cannot bind to.

For now use 255.255.255.254 which is about as illegal as an IP# can
be for TCP purposes.

Use instead of 127.0.0.2, which appearantly Linux allows you to bind to.



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@4499 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 7c7f18d3
......@@ -2,7 +2,7 @@
test "Test CLI help and parameter functions"
varnish v1 -arg "-b 127.0.0.2:9080"
varnish v1 -arg "-b ${bad_ip}:9080"
varnish v1 -cliok "help"
......
......@@ -6,7 +6,7 @@ test "Check synthetic error page caching"
varnish v1 -vcl {
backend foo {
.host = "127.0.0.2"; .port = "9080";
.host = "${bad_ip}"; .port = "9080";
}
} -start
......
......@@ -4,7 +4,7 @@ test "Check naming of backends"
varnish v1 -vcl {
backend foo {
.host = "127.0.0.2"; .port = "9080";
.host = "${bad_ip}"; .port = "9080";
}
sub vcl_recv {
......@@ -26,7 +26,7 @@ varnish v1 -vcl {
director bar random {
{
.backend = {
.host = "127.0.0.2"; .port = "9080";
.host = "${bad_ip}"; .port = "9080";
}
.weight = 1;
}
......@@ -50,7 +50,7 @@ client c1 {
varnish v1 -vcl {
director baz round-robin {
{ .backend = {
.host = "127.0.0.2"; .port = "9080";
.host = "${bad_ip}"; .port = "9080";
} }
}
......
......@@ -4,7 +4,7 @@ test "Check that we close one error"
varnish v1 -vcl {
backend foo {
.host = "127.0.0.2"; .port = "9080";
.host = "${bad_ip}"; .port = "9080";
}
sub vcl_recv {
error 888;
......
......@@ -9,11 +9,9 @@ server s1 {
txresp -hdr "Connection: close" -body "012345\n"
} -start
# 198.18.1.1 is IANA-reserved for Network Interconnect Device
# Benchmark Testing
varnish v1 -cliok "param.set listen_address 127.0.0.2:0"
varnish v1 -cliok "param.set listen_address ${bad_ip}:0"
varnish v1 -vcl+backend {} -clierr 300 start
varnish v1 -cliok "param.set listen_address 127.0.0.1:0,127.0.0.2:9082"
varnish v1 -cliok "param.set listen_address 127.0.0.1:0,${bad_ip}:9082"
varnish v1 -start
client c1 {
......
......@@ -4,7 +4,7 @@ test "Test that we can't recurse restarts forever"
varnish v1 -vcl {
backend bad {
.host = "127.0.0.2"; .port = "9090";
.host = "${bad_ip}"; .port = "9090";
}
sub vcl_recv {
......
......@@ -59,7 +59,7 @@ varnish v1 -badvcl {
# Check backend reference by name
varnish v1 -badvcl {
backend b1 { .host = "127.0.0.2"; }
backend b1 { .host = "${bad_ip}"; }
director r1 random {
{ .weight = 1; .backend = b1; }
{ .weight = 1; .backend = { .host = "127.0.0.3"; } }
......@@ -69,18 +69,18 @@ varnish v1 -badvcl {
# Check backend reference by name
varnish v1 -badvcl {
backend b1 { .host = "127.0.0.2"; }
backend b1 { .host = "${bad_ip}"; }
backend b2 b1;
}
# Check backend reference by non-C-compat name
varnish v1 -badvcl {
backend b-1 { .host = "127.0.0.2"; }
backend b-1 { .host = "${bad_ip}"; }
}
# Check backend reference by non-C-compat name
varnish v1 -badvcl {
backend b1 { .host = "127.0.0.2"; }
backend b1 { .host = "${bad_ip}"; }
sub vcl_recv {
set req.backend = b-1;
}
......
......@@ -561,6 +561,8 @@ main(int argc, char * const *argv)
AZ(mkdir(vtc_tmpdir, 0700));
macro_def(vl, NULL, "tmpdir", vtc_tmpdir);
vtc_thread = pthread_self();
macro_def(vl, NULL, "bad_ip", "255.255.255.254");
tmax = 0;
nmax = NULL;
t00 = TIM_mono();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment