r3052 - trunk/varnish-cache/bin/varnishtest/tests
phk at projects.linpro.no
phk at projects.linpro.no
Fri Aug 1 10:24:23 CEST 2008
Author: phk
Date: 2008-08-01 10:24:23 +0200 (Fri, 01 Aug 2008)
New Revision: 3052
Modified:
trunk/varnish-cache/bin/varnishtest/tests/b00000.vtc
trunk/varnish-cache/bin/varnishtest/tests/b00001.vtc
trunk/varnish-cache/bin/varnishtest/tests/b00002.vtc
trunk/varnish-cache/bin/varnishtest/tests/b00003.vtc
trunk/varnish-cache/bin/varnishtest/tests/b00004.vtc
trunk/varnish-cache/bin/varnishtest/tests/b00005.vtc
trunk/varnish-cache/bin/varnishtest/tests/b00006.vtc
trunk/varnish-cache/bin/varnishtest/tests/b00007.vtc
trunk/varnish-cache/bin/varnishtest/tests/b00008.vtc
trunk/varnish-cache/bin/varnishtest/tests/b00009.vtc
trunk/varnish-cache/bin/varnishtest/tests/b00010.vtc
trunk/varnish-cache/bin/varnishtest/tests/b00011.vtc
trunk/varnish-cache/bin/varnishtest/tests/b00012.vtc
trunk/varnish-cache/bin/varnishtest/tests/b00013.vtc
trunk/varnish-cache/bin/varnishtest/tests/b00014.vtc
trunk/varnish-cache/bin/varnishtest/tests/b00015.vtc
Log:
Go over the b* series of tests:
add expectes for stats counters where necessary
generally polish.
Modified: trunk/varnish-cache/bin/varnishtest/tests/b00000.vtc
===================================================================
--- trunk/varnish-cache/bin/varnishtest/tests/b00000.vtc 2008-08-01 08:23:30 UTC (rev 3051)
+++ trunk/varnish-cache/bin/varnishtest/tests/b00000.vtc 2008-08-01 08:24:23 UTC (rev 3052)
@@ -2,23 +2,29 @@
#
# $Id$
-varnish v1 -arg "-b 127.0.0.1:9080" -start
+test "Does anything get through at all ?"
server s1 {
rxreq
- txresp -hdr "Connection: close" -body "012345\n"
-}
+ txresp -body "012345\n"
+} -start
-server s1 -start
+varnish v1 -vcl+backend {} -start
+varnish v1 -expect n_object == 0
+varnish v1 -expect client_conn == 0
+varnish v1 -expect client_req == 0
+varnish v1 -expect cache_miss == 0
+
client c1 {
txreq -url "/"
rxresp
expect resp.status == 200
-}
+} -run
-client c1 -run
-
-server s1 -wait
-
-varnish v1 -stop
+varnish v1 -expect n_object == 1
+varnish v1 -expect client_conn == 1
+varnish v1 -expect client_req == 1
+varnish v1 -expect cache_miss == 1
+varnish v1 -expect s_sess == 1
+varnish v1 -expect s_req == 1
Modified: trunk/varnish-cache/bin/varnishtest/tests/b00001.vtc
===================================================================
--- trunk/varnish-cache/bin/varnishtest/tests/b00001.vtc 2008-08-01 08:23:30 UTC (rev 3051)
+++ trunk/varnish-cache/bin/varnishtest/tests/b00001.vtc 2008-08-01 08:24:23 UTC (rev 3052)
@@ -4,10 +4,8 @@
server s1 -repeat 1 {
rxreq
- txresp \
- -hdr "Connection: close" \
- -body "012345\n"
-}
+ txresp -body "012345\n"
+} -start
varnish v1 -vcl+backend {
sub vcl_recv {
@@ -15,12 +13,18 @@
}
} -start
-server s1 -start
-
client c1 {
txreq -url "/"
rxresp
expect resp.status == 200
-}
+} -run
-client c1 -run
+# Give varnish a chance to update stats
+delay .1
+
+varnish v1 -expect n_object == 0
+varnish v1 -expect client_conn == 1
+varnish v1 -expect client_req == 1
+varnish v1 -expect s_sess == 1
+varnish v1 -expect s_req == 1
+varnish v1 -expect s_pipe == 1
Modified: trunk/varnish-cache/bin/varnishtest/tests/b00002.vtc
===================================================================
--- trunk/varnish-cache/bin/varnishtest/tests/b00002.vtc 2008-08-01 08:23:30 UTC (rev 3051)
+++ trunk/varnish-cache/bin/varnishtest/tests/b00002.vtc 2008-08-01 08:24:23 UTC (rev 3052)
@@ -2,12 +2,10 @@
test "Check that a pass transaction works"
-server s1 -repeat 1 {
+server s1 {
rxreq
- txresp \
- -hdr "Connection: close" \
- -body "012345\n"
-}
+ txresp -hdr "Connection: close" -body "012345\n"
+} -start
varnish v1 -vcl+backend {
sub vcl_recv {
@@ -15,12 +13,18 @@
}
} -start
-server s1 -start
-
client c1 {
txreq -url "/"
rxresp
expect resp.status == 200
-}
+} -run
-client c1 -run
+# Give varnish a chance to update stats
+delay .1
+
+varnish v1 -expect n_object == 0
+varnish v1 -expect client_conn == 1
+varnish v1 -expect client_req == 1
+varnish v1 -expect s_sess == 1
+varnish v1 -expect s_req == 1
+varnish v1 -expect s_pass == 1
Modified: trunk/varnish-cache/bin/varnishtest/tests/b00003.vtc
===================================================================
--- trunk/varnish-cache/bin/varnishtest/tests/b00003.vtc 2008-08-01 08:23:30 UTC (rev 3051)
+++ trunk/varnish-cache/bin/varnishtest/tests/b00003.vtc 2008-08-01 08:24:23 UTC (rev 3052)
@@ -4,28 +4,32 @@
server s1 {
rxreq
- txresp \
- -hdr "Connection: close" \
- -body "012345\n"
-}
+ txresp -hdr "Connection: close" -body "012345\n"
+} -start
varnish v1 -vcl+backend { } -start
-server s1 -start
-
client c1 {
txreq -url "/"
rxresp
expect resp.status == 200
expect resp.http.X-Varnish == "1001"
-}
+} -run
client c2 {
txreq -url "/"
rxresp
expect resp.status == 200
expect resp.http.X-Varnish == "1002 1001"
-}
+} -run
-client c1 -run
-client c2 -run
+# Give varnish a chance to update stats
+delay .1
+
+varnish v1 -expect client_conn == 2
+varnish v1 -expect cache_hit == 1
+varnish v1 -expect cache_miss == 1
+varnish v1 -expect client_req == 2
+varnish v1 -expect s_sess == 2
+varnish v1 -expect s_req == 2
+varnish v1 -expect s_fetch == 1
Modified: trunk/varnish-cache/bin/varnishtest/tests/b00004.vtc
===================================================================
--- trunk/varnish-cache/bin/varnishtest/tests/b00004.vtc 2008-08-01 08:23:30 UTC (rev 3051)
+++ trunk/varnish-cache/bin/varnishtest/tests/b00004.vtc 2008-08-01 08:24:23 UTC (rev 3052)
@@ -8,21 +8,21 @@
varnish v1 -vcl+backend { }
-varnish v1 -cli start
-varnish v1 -cli start
-varnish v1 -cli start
+varnish v1 -cliok start
+varnish v1 -clierr 300 start
+varnish v1 -clierr 300 start
-varnish v1 -cli stop
-varnish v1 -cli stop
-varnish v1 -cli stop
+varnish v1 -cliok stop
+varnish v1 -clierr 300 stop
+varnish v1 -clierr 300 stop
-varnish v1 -cli start
-varnish v1 -cli stop
+varnish v1 -cliok start
+varnish v1 -cliok stop
-varnish v1 -cli start
-varnish v1 -cli stop
+varnish v1 -cliok start
+varnish v1 -cliok stop
-varnish v1 -cli start
-varnish v1 -cli stop
+varnish v1 -cliok start
+varnish v1 -cliok stop
varnish v1 -wait
Modified: trunk/varnish-cache/bin/varnishtest/tests/b00005.vtc
===================================================================
--- trunk/varnish-cache/bin/varnishtest/tests/b00005.vtc 2008-08-01 08:23:30 UTC (rev 3051)
+++ trunk/varnish-cache/bin/varnishtest/tests/b00005.vtc 2008-08-01 08:24:23 UTC (rev 3052)
@@ -2,23 +2,19 @@
test "Check that -s works"
-varnish v1 -arg "-s file,varnishtest_backing,10M -b 127.0.0.1:9080" -start
-
server s1 {
rxreq
txresp -hdr "Connection: close" -body "012345\n"
-}
+} -start
-server s1 -start
+varnish v1 -arg "-s file,varnishtest_backing,10M" -vcl+backend {} -start
client c1 {
txreq -url "/"
rxresp
expect resp.status == 200
-}
+} -run
-client c1 -run
-
server s1 -wait
varnish v1 -stop
Modified: trunk/varnish-cache/bin/varnishtest/tests/b00006.vtc
===================================================================
--- trunk/varnish-cache/bin/varnishtest/tests/b00006.vtc 2008-08-01 08:23:30 UTC (rev 3051)
+++ trunk/varnish-cache/bin/varnishtest/tests/b00006.vtc 2008-08-01 08:24:23 UTC (rev 3052)
@@ -2,23 +2,15 @@
test "Check that -s malloc works"
-varnish v1 -arg "-s malloc -b 127.0.0.1:9080" -start
-
server s1 {
rxreq
txresp -hdr "Connection: close" -body "012345\n"
-}
+} -start
-server s1 -start
+varnish v1 -arg "-s malloc" -vcl+backend {} -start
client c1 {
txreq -url "/"
rxresp
expect resp.status == 200
-}
-
-client c1 -run
-
-server s1 -wait
-
-varnish v1 -stop
+} -run
Modified: trunk/varnish-cache/bin/varnishtest/tests/b00007.vtc
===================================================================
--- trunk/varnish-cache/bin/varnishtest/tests/b00007.vtc 2008-08-01 08:23:30 UTC (rev 3051)
+++ trunk/varnish-cache/bin/varnishtest/tests/b00007.vtc 2008-08-01 08:24:23 UTC (rev 3052)
@@ -2,8 +2,6 @@
test "Check chunked encoding from backend works"
-varnish v1 -arg "-s malloc -b 127.0.0.1:9080" -start
-
server s1 {
rxreq
expect req.url == "/bar"
@@ -21,9 +19,9 @@
send "00000004\r\n1234\r\n"
chunked "1234"
chunked ""
-}
+} -start
-server s1 -start
+varnish v1 -vcl+backend {} -start
client c1 {
txreq -url "/bar"
@@ -34,6 +32,4 @@
rxresp
expect resp.status == 200
expect resp.http.content-length == "8"
-}
-
-client c1 -run
+} -run
Modified: trunk/varnish-cache/bin/varnishtest/tests/b00008.vtc
===================================================================
--- trunk/varnish-cache/bin/varnishtest/tests/b00008.vtc 2008-08-01 08:23:30 UTC (rev 3051)
+++ trunk/varnish-cache/bin/varnishtest/tests/b00008.vtc 2008-08-01 08:24:23 UTC (rev 3052)
@@ -2,20 +2,20 @@
test "Test CLI help and parameter functions"
-varnish v1 -arg "-b localhost:9080"
+varnish v1 -arg "-b 127.0.0.2:9080"
-varnish v1 -cli "help"
+varnish v1 -cliok "help"
-varnish v1 -cli "param.show"
+varnish v1 -cliok "param.show"
-varnish v1 -cli "param.show diag_bitmap"
+varnish v1 -cliok "param.show diag_bitmap"
-varnish v1 -cli "param.set diag_bitmap 0x40"
+varnish v1 -cliok "param.set diag_bitmap 0x40"
-varnish v1 -cli "param.set diag_bitmap 0x0"
+varnish v1 -cliok "param.set diag_bitmap 0x0"
varnish v1 -start
-varnish v1 -cli "help"
+varnish v1 -cliok "help"
-varnish v1 -cli "stats"
+varnish v1 -cliok "stats"
Modified: trunk/varnish-cache/bin/varnishtest/tests/b00009.vtc
===================================================================
--- trunk/varnish-cache/bin/varnishtest/tests/b00009.vtc 2008-08-01 08:23:30 UTC (rev 3051)
+++ trunk/varnish-cache/bin/varnishtest/tests/b00009.vtc 2008-08-01 08:24:23 UTC (rev 3052)
@@ -2,23 +2,15 @@
test "Check poll acceptor"
-varnish v1 -arg "-p acceptor=poll -b 127.0.0.1:9080" -start
-
server s1 {
rxreq
txresp -hdr "Connection: close" -body "012345\n"
-}
+} -start
-server s1 -start
+varnish v1 -arg "-p acceptor=poll" -vcl+backend {} -start
client c1 {
txreq -url "/"
rxresp
expect resp.status == 200
-}
-
-client c1 -run
-
-server s1 -wait
-
-varnish v1 -stop
+} -run
Modified: trunk/varnish-cache/bin/varnishtest/tests/b00010.vtc
===================================================================
--- trunk/varnish-cache/bin/varnishtest/tests/b00010.vtc 2008-08-01 08:23:30 UTC (rev 3051)
+++ trunk/varnish-cache/bin/varnishtest/tests/b00010.vtc 2008-08-01 08:24:23 UTC (rev 3052)
@@ -2,14 +2,12 @@
test "Check simple list hasher"
-varnish v1 -arg "-h simple_list -b 127.0.0.1:9080" -start
-
server s1 {
rxreq
txresp -hdr "Connection: close" -body "012345\n"
-}
+} -start
-server s1 -start
+varnish v1 -arg "-h simple_list" -vcl+backend {} -start
client c1 {
txreq -url "/"
@@ -19,10 +17,4 @@
rxresp
expect resp.status == 200
expect resp.http.x-varnish == "1002 1001"
-}
-
-client c1 -run
-
-server s1 -wait
-
-varnish v1 -stop
+} -run
Modified: trunk/varnish-cache/bin/varnishtest/tests/b00011.vtc
===================================================================
--- trunk/varnish-cache/bin/varnishtest/tests/b00011.vtc 2008-08-01 08:23:30 UTC (rev 3051)
+++ trunk/varnish-cache/bin/varnishtest/tests/b00011.vtc 2008-08-01 08:24:23 UTC (rev 3052)
@@ -2,23 +2,19 @@
test "Check HTTP/1.0 EOF transmission"
-varnish v1 -arg "-h simple_list -b 127.0.0.1:9080" -start
-
server s1 {
rxreq
txresp -hdr "Connection: close"
send "Body line 1\n"
send "Body line 2\n"
send "Body line 3\n"
-}
+} -start
-server s1 -start
+varnish v1 -vcl+backend {} -start
client c1 {
txreq -url "/"
rxresp
expect resp.status == 200
expect resp.http.content-length == 36
-}
-
-client c1 -run
+} -run
Modified: trunk/varnish-cache/bin/varnishtest/tests/b00012.vtc
===================================================================
--- trunk/varnish-cache/bin/varnishtest/tests/b00012.vtc 2008-08-01 08:23:30 UTC (rev 3051)
+++ trunk/varnish-cache/bin/varnishtest/tests/b00012.vtc 2008-08-01 08:24:23 UTC (rev 3052)
@@ -2,8 +2,6 @@
test "Check pipelining"
-varnish v1 -arg "-h simple_list -b 127.0.0.1:9080" -start
-
server s1 {
rxreq
expect req.url == "/foo"
@@ -11,9 +9,9 @@
rxreq
expect req.url == "/bar"
txresp -body "foobar"
-}
+} -start
-server s1 -start
+varnish v1 -vcl+backend {} -start
client c1 {
send "GET /foo HTTP/1.1\n\nGET /bar HTTP/1.1\n\nGET /bar HTTP/1.1\n\n"
@@ -29,6 +27,6 @@
expect resp.status == 200
expect resp.http.content-length == 6
expect resp.http.x-varnish == "1003 1002"
-}
+} -run
-client c1 -run
+varnish v1 -expect sess_pipeline == 2
Modified: trunk/varnish-cache/bin/varnishtest/tests/b00013.vtc
===================================================================
--- trunk/varnish-cache/bin/varnishtest/tests/b00013.vtc 2008-08-01 08:23:30 UTC (rev 3051)
+++ trunk/varnish-cache/bin/varnishtest/tests/b00013.vtc 2008-08-01 08:24:23 UTC (rev 3052)
@@ -2,8 +2,6 @@
test "Check read-head / partial pipelining"
-varnish v1 -arg "-h simple_list -b 127.0.0.1:9080" -start
-
server s1 {
rxreq
expect req.url == "/foo"
@@ -11,9 +9,9 @@
rxreq
expect req.url == "/bar"
txresp -body "foobar"
-}
+} -start
-server s1 -start
+varnish v1 -vcl+backend {} -start
client c1 {
send "GET /foo HTTP/1.1\n\nGET "
@@ -31,6 +29,6 @@
expect resp.status == 200
expect resp.http.content-length == 6
expect resp.http.x-varnish == "1003 1002"
-}
+} -run
-client c1 -run
+varnish v1 -expect sess_readahead == 2
Modified: trunk/varnish-cache/bin/varnishtest/tests/b00014.vtc
===================================================================
--- trunk/varnish-cache/bin/varnishtest/tests/b00014.vtc 2008-08-01 08:23:30 UTC (rev 3051)
+++ trunk/varnish-cache/bin/varnishtest/tests/b00014.vtc 2008-08-01 08:24:23 UTC (rev 3052)
@@ -3,7 +3,7 @@
test "Check -f command line arg"
shell "echo 'backend foo { .host = \"127.0.0.1\"; .port = \"9080\"; }' > /tmp/_b00014.vcl"
-varnish v1 -arg "-h simple_list -f /tmp/_b00014.vcl" -start
+varnish v1 -arg "-f /tmp/_b00014.vcl" -start
server s1 {
rxreq
@@ -19,7 +19,7 @@
rxresp
} -run
-varnish v1 -cli "vcl.load foo /tmp/_b00014.vcl" -cli "vcl.use foo"
+varnish v1 -cliok "vcl.load foo /tmp/_b00014.vcl" -cliok "vcl.use foo"
client c1 {
txreq -url /bar
Modified: trunk/varnish-cache/bin/varnishtest/tests/b00015.vtc
===================================================================
--- trunk/varnish-cache/bin/varnishtest/tests/b00015.vtc 2008-08-01 08:23:30 UTC (rev 3051)
+++ trunk/varnish-cache/bin/varnishtest/tests/b00015.vtc 2008-08-01 08:24:23 UTC (rev 3052)
@@ -2,7 +2,6 @@
test "Check synthetic error page caching"
-
# First test that an internally generated error is not cached
varnish v1 -vcl {
@@ -41,8 +40,6 @@
expect resp.http.X-varnish == "1003"
} -run
-server s1 -wait
-
client c1 {
txreq -url "/"
rxresp
@@ -64,7 +61,7 @@
set obj.ttl = 10m;
}
}
- }
+}
client c1 {
txreq -url "/2"
@@ -73,8 +70,6 @@
expect resp.http.X-varnish == "1005"
} -run
-server s1 -wait
-
client c1 {
txreq -url "/2"
rxresp
More information about the varnish-commit
mailing list