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 @@ ...@@ -2,7 +2,7 @@
test "Test CLI help and parameter functions" 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" varnish v1 -cliok "help"
......
...@@ -6,7 +6,7 @@ test "Check synthetic error page caching" ...@@ -6,7 +6,7 @@ test "Check synthetic error page caching"
varnish v1 -vcl { varnish v1 -vcl {
backend foo { backend foo {
.host = "127.0.0.2"; .port = "9080"; .host = "${bad_ip}"; .port = "9080";
} }
} -start } -start
......
...@@ -4,7 +4,7 @@ test "Check naming of backends" ...@@ -4,7 +4,7 @@ test "Check naming of backends"
varnish v1 -vcl { varnish v1 -vcl {
backend foo { backend foo {
.host = "127.0.0.2"; .port = "9080"; .host = "${bad_ip}"; .port = "9080";
} }
sub vcl_recv { sub vcl_recv {
...@@ -26,7 +26,7 @@ varnish v1 -vcl { ...@@ -26,7 +26,7 @@ varnish v1 -vcl {
director bar random { director bar random {
{ {
.backend = { .backend = {
.host = "127.0.0.2"; .port = "9080"; .host = "${bad_ip}"; .port = "9080";
} }
.weight = 1; .weight = 1;
} }
...@@ -50,7 +50,7 @@ client c1 { ...@@ -50,7 +50,7 @@ client c1 {
varnish v1 -vcl { varnish v1 -vcl {
director baz round-robin { director baz round-robin {
{ .backend = { { .backend = {
.host = "127.0.0.2"; .port = "9080"; .host = "${bad_ip}"; .port = "9080";
} } } }
} }
......
...@@ -4,7 +4,7 @@ test "Check that we close one error" ...@@ -4,7 +4,7 @@ test "Check that we close one error"
varnish v1 -vcl { varnish v1 -vcl {
backend foo { backend foo {
.host = "127.0.0.2"; .port = "9080"; .host = "${bad_ip}"; .port = "9080";
} }
sub vcl_recv { sub vcl_recv {
error 888; error 888;
......
...@@ -9,11 +9,9 @@ server s1 { ...@@ -9,11 +9,9 @@ server s1 {
txresp -hdr "Connection: close" -body "012345\n" txresp -hdr "Connection: close" -body "012345\n"
} -start } -start
# 198.18.1.1 is IANA-reserved for Network Interconnect Device varnish v1 -cliok "param.set listen_address ${bad_ip}:0"
# Benchmark Testing
varnish v1 -cliok "param.set listen_address 127.0.0.2:0"
varnish v1 -vcl+backend {} -clierr 300 start 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 varnish v1 -start
client c1 { client c1 {
......
...@@ -4,7 +4,7 @@ test "Test that we can't recurse restarts forever" ...@@ -4,7 +4,7 @@ test "Test that we can't recurse restarts forever"
varnish v1 -vcl { varnish v1 -vcl {
backend bad { backend bad {
.host = "127.0.0.2"; .port = "9090"; .host = "${bad_ip}"; .port = "9090";
} }
sub vcl_recv { sub vcl_recv {
......
...@@ -59,7 +59,7 @@ varnish v1 -badvcl { ...@@ -59,7 +59,7 @@ varnish v1 -badvcl {
# Check backend reference by name # Check backend reference by name
varnish v1 -badvcl { varnish v1 -badvcl {
backend b1 { .host = "127.0.0.2"; } backend b1 { .host = "${bad_ip}"; }
director r1 random { director r1 random {
{ .weight = 1; .backend = b1; } { .weight = 1; .backend = b1; }
{ .weight = 1; .backend = { .host = "127.0.0.3"; } } { .weight = 1; .backend = { .host = "127.0.0.3"; } }
...@@ -69,18 +69,18 @@ varnish v1 -badvcl { ...@@ -69,18 +69,18 @@ varnish v1 -badvcl {
# Check backend reference by name # Check backend reference by name
varnish v1 -badvcl { varnish v1 -badvcl {
backend b1 { .host = "127.0.0.2"; } backend b1 { .host = "${bad_ip}"; }
backend b2 b1; backend b2 b1;
} }
# Check backend reference by non-C-compat name # Check backend reference by non-C-compat name
varnish v1 -badvcl { 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 # Check backend reference by non-C-compat name
varnish v1 -badvcl { varnish v1 -badvcl {
backend b1 { .host = "127.0.0.2"; } backend b1 { .host = "${bad_ip}"; }
sub vcl_recv { sub vcl_recv {
set req.backend = b-1; set req.backend = b-1;
} }
......
...@@ -561,6 +561,8 @@ main(int argc, char * const *argv) ...@@ -561,6 +561,8 @@ main(int argc, char * const *argv)
AZ(mkdir(vtc_tmpdir, 0700)); AZ(mkdir(vtc_tmpdir, 0700));
macro_def(vl, NULL, "tmpdir", vtc_tmpdir); macro_def(vl, NULL, "tmpdir", vtc_tmpdir);
vtc_thread = pthread_self(); vtc_thread = pthread_self();
macro_def(vl, NULL, "bad_ip", "255.255.255.254");
tmax = 0; tmax = 0;
nmax = NULL; nmax = NULL;
t00 = TIM_mono(); 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