#
# $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
server s1 -repeat 1 {
rxreq
- txresp \
- -hdr "Connection: close" \
- -body "012345\n"
-}
+ txresp -body "012345\n"
+} -start
varnish v1 -vcl+backend {
sub vcl_recv {
}
} -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
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 {
}
} -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
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
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
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
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
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"
send "00000004\r\n1234\r\n"
chunked "1234"
chunked ""
-}
+} -start
-server s1 -start
+varnish v1 -vcl+backend {} -start
client c1 {
txreq -url "/bar"
rxresp
expect resp.status == 200
expect resp.http.content-length == "8"
-}
-
-client c1 -run
+} -run
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"
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
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 "/"
rxresp
expect resp.status == 200
expect resp.http.x-varnish == "1002 1001"
-}
-
-client c1 -run
-
-server s1 -wait
-
-varnish v1 -stop
+} -run
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
test "Check pipelining"
-varnish v1 -arg "-h simple_list -b 127.0.0.1:9080" -start
-
server s1 {
rxreq
expect req.url == "/foo"
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"
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
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"
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 "
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
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
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
test "Check synthetic error page caching"
-
# First test that an internally generated error is not cached
varnish v1 -vcl {
expect resp.http.X-varnish == "1003"
} -run
-server s1 -wait
-
client c1 {
txreq -url "/"
rxresp
set obj.ttl = 10m;
}
}
- }
+}
client c1 {
txreq -url "/2"
expect resp.http.X-varnish == "1005"
} -run
-server s1 -wait
-
client c1 {
txreq -url "/2"
rxresp