From c99e7ae76444ea269d062b5e40d3799704820915 Mon Sep 17 00:00:00 2001 From: phk Date: Fri, 1 Aug 2008 09:22:21 +0000 Subject: [PATCH] Be much more explicit about localhost. Force varnish instance into /tmp/__${name} git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3053 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/bin/varnishtest/tests/c00001.vtc | 8 ++------ varnish-cache/bin/varnishtest/tests/c00002.vtc | 18 +++++++----------- varnish-cache/bin/varnishtest/tests/c00003.vtc | 13 ++++++------- varnish-cache/bin/varnishtest/tests/c00004.vtc | 4 +--- varnish-cache/bin/varnishtest/tests/c00005.vtc | 6 ++---- varnish-cache/bin/varnishtest/vtc_client.c | 2 +- varnish-cache/bin/varnishtest/vtc_varnish.c | 14 +++++++++----- 7 files changed, 28 insertions(+), 37 deletions(-) diff --git a/varnish-cache/bin/varnishtest/tests/c00001.vtc b/varnish-cache/bin/varnishtest/tests/c00001.vtc index b287a8f5..ccbf6538 100644 --- a/varnish-cache/bin/varnishtest/tests/c00001.vtc +++ b/varnish-cache/bin/varnishtest/tests/c00001.vtc @@ -8,7 +8,7 @@ server s1 { -hdr "Foobar: _barf_" \ -hdr "Connection: close" \ -body "012345\n" -} +} -start varnish v1 -vcl+backend { sub vcl_fetch { @@ -26,8 +26,6 @@ varnish v1 -vcl+backend { } } -start -server s1 -start - client c1 { txreq -url "/" rxresp @@ -41,6 +39,4 @@ client c1 { expect resp.http.snafu5 == "_barffra\p_" # NB: have to escape the \\ in the next line expect resp.http.snafu6 == "_f&rap\\_" -} - -client c1 -run +} -run diff --git a/varnish-cache/bin/varnishtest/tests/c00002.vtc b/varnish-cache/bin/varnishtest/tests/c00002.vtc index ebcc6021..5edce31e 100644 --- a/varnish-cache/bin/varnishtest/tests/c00002.vtc +++ b/varnish-cache/bin/varnishtest/tests/c00002.vtc @@ -2,25 +2,21 @@ # # $Id$ -test "Check that multiple thread pools all get started" - -varnish v1 -arg "-b 127.0.0.1:9080 -p thread_pools=9" -start +test "Check that all thread pools all get started and get minimum threads" server s1 { rxreq txresp -hdr "Connection: close" -body "012345\n" -} +} -start + +varnish v1 -arg "-p thread_pool_min=2 -p thread_pools=4" -vcl+backend {} -start -server s1 -start +delay 1 +varnish v1 -expect n_wrk_create == 8 client c1 { txreq -url "/" rxresp expect resp.status == 200 -} - -client c1 -run - -server s1 -wait +} -run -varnish v1 -stop diff --git a/varnish-cache/bin/varnishtest/tests/c00003.vtc b/varnish-cache/bin/varnishtest/tests/c00003.vtc index e90e2c37..0ef12a8c 100644 --- a/varnish-cache/bin/varnishtest/tests/c00003.vtc +++ b/varnish-cache/bin/varnishtest/tests/c00003.vtc @@ -2,21 +2,20 @@ # # $Id$ -test "Check that we start if one listen address works" - -varnish v1 -accept ":9081 127.0.0.2:9082" -arg "-b 127.0.0.1:9080" -start +test "Check that we start if at least one listen address works" server s1 { rxreq txresp -hdr "Connection: close" -body "012345\n" } -start +varnish v1 -cliok "param.set listen_address 127.0.0.2:9082" +varnish v1 -vcl+backend {} -clierr 300 start +varnish v1 -cliok "param.set listen_address :9081,127.0.0.2:9082" +varnish v1 -start + client c1 { txreq -url "/" rxresp expect resp.status == 200 } -run - -server s1 -wait - -varnish v1 -stop diff --git a/varnish-cache/bin/varnishtest/tests/c00004.vtc b/varnish-cache/bin/varnishtest/tests/c00004.vtc index ea712102..2978ab34 100644 --- a/varnish-cache/bin/varnishtest/tests/c00004.vtc +++ b/varnish-cache/bin/varnishtest/tests/c00004.vtc @@ -49,6 +49,4 @@ client c1 { expect resp.http.X-Varnish == "1005 1001" expect resp.http.snafu == "1" -} - -client c1 -run +} -run diff --git a/varnish-cache/bin/varnishtest/tests/c00005.vtc b/varnish-cache/bin/varnishtest/tests/c00005.vtc index ae58a22d..fb7e7819 100644 --- a/varnish-cache/bin/varnishtest/tests/c00005.vtc +++ b/varnish-cache/bin/varnishtest/tests/c00005.vtc @@ -1,6 +1,6 @@ # $Id$ -test "Test simple ACL (May fail on Linux)" +test "Test simple ACL" server s1 { rxreq @@ -27,9 +27,7 @@ client c1 { txreq -url "foo" rxresp expect resp.status == 200 -} - -client c1 -run +} -run varnish v1 -vcl+backend { acl acl1 { diff --git a/varnish-cache/bin/varnishtest/vtc_client.c b/varnish-cache/bin/varnishtest/vtc_client.c index 746c1de9..632274a3 100644 --- a/varnish-cache/bin/varnishtest/vtc_client.c +++ b/varnish-cache/bin/varnishtest/vtc_client.c @@ -112,7 +112,7 @@ client_new(char *name) exit (1); } - c->connect = ":9081"; + c->connect = "127.0.0.1:9081"; VTAILQ_INSERT_TAIL(&clients, c, list); return (c); } diff --git a/varnish-cache/bin/varnishtest/vtc_varnish.c b/varnish-cache/bin/varnishtest/vtc_varnish.c index 3a65b520..bd7fccca 100644 --- a/varnish-cache/bin/varnishtest/vtc_varnish.c +++ b/varnish-cache/bin/varnishtest/vtc_varnish.c @@ -148,8 +148,8 @@ varnish_new(char *name) } v->args = ""; - v->telnet = ":9001"; - v->accept = ":9081"; + v->telnet = "127.0.0.1:9001"; + v->accept = "127.0.0.1:9081"; v->cli_fd = -1; VTAILQ_INSERT_TAIL(&varnishes, v, list); return (v); @@ -191,7 +191,7 @@ varnish_launch(struct varnish *v) vsb = vsb_newauto(); AN(vsb); vsb_printf(vsb, "cd ../varnishd &&"); - vsb_printf(vsb, " ./varnishd -d -d -n %s", v->name); + vsb_printf(vsb, " ./varnishd -d -d -n /tmp/__%s", v->name); vsb_printf(vsb, " -a '%s' -T %s", v->accept, v->telnet); vsb_printf(vsb, " %s", v->args); vsb_finish(vsb); @@ -235,8 +235,12 @@ varnish_launch(struct varnish *v) } vtc_log(v->vl, 3, "CLI connection fd = %d", v->cli_fd); assert(v->cli_fd >= 0); - v->stats = VSL_OpenStats(v->name); - + vsb = vsb_newauto(); + vsb_printf(vsb, "/tmp/__%s", v->name); + vsb_finish(vsb); + AZ(vsb_overflowed(vsb)); + v->stats = VSL_OpenStats(vsb_data(vsb)); + vsb_delete(vsb); } /********************************************************************** -- 2.39.5