Commit 2b3ff9d1 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Go over the b* series of tests:

	add expectes for stats counters where necessary
	generally polish.



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@3052 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 2eba7e96
......@@ -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
}
client c1 -run
server s1 -wait
} -run
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
......@@ -4,10 +4,8 @@ test "Check that a pipe transaction works"
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 @@ varnish v1 -vcl+backend {
}
} -start
server s1 -start
client c1 {
txreq -url "/"
rxresp
expect resp.status == 200
}
} -run
# Give varnish a chance to update stats
delay .1
client c1 -run
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
......@@ -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 @@ varnish v1 -vcl+backend {
}
} -start
server s1 -start
client c1 {
txreq -url "/"
rxresp
expect resp.status == 200
}
} -run
# Give varnish a chance to update stats
delay .1
client c1 -run
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
......@@ -4,28 +4,32 @@ test "Check that a cache fetch + hit transaction works"
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
# Give varnish a chance to update stats
delay .1
client c1 -run
client c2 -run
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
......@@ -8,21 +8,21 @@ server s1 {
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
......@@ -2,22 +2,18 @@
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
}
client c1 -run
} -run
server s1 -wait
......
......@@ -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
......@@ -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 @@ server s1 {
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 @@ client c1 {
rxresp
expect resp.status == 200
expect resp.http.content-length == "8"
}
client c1 -run
} -run
......@@ -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"
......@@ -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
......@@ -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 @@ client c1 {
rxresp
expect resp.status == 200
expect resp.http.x-varnish == "1002 1001"
}
client c1 -run
server s1 -wait
varnish v1 -stop
} -run
......@@ -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
......@@ -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 @@ server s1 {
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 @@ client c1 {
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
......@@ -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 @@ server s1 {
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 @@ client c1 {
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
......@@ -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 @@ client c1 {
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
......
......@@ -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 @@ client c1 {
expect resp.http.X-varnish == "1003"
} -run
server s1 -wait
client c1 {
txreq -url "/"
rxresp
......@@ -64,7 +61,7 @@ varnish v1 -vcl+backend {
set obj.ttl = 10m;
}
}
}
}
client c1 {
txreq -url "/2"
......@@ -73,8 +70,6 @@ client c1 {
expect resp.http.X-varnish == "1005"
} -run
server s1 -wait
client c1 {
txreq -url "/2"
rxresp
......
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