]> err.no Git - varnish/commitdiff
Make the first testcase a test of the testprogram
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Sun, 15 Jun 2008 11:22:55 +0000 (11:22 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Sun, 15 Jun 2008 11:22:55 +0000 (11:22 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2672 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishtest/t000.vtc
varnish-cache/bin/varnishtest/t001.vtc [new file with mode: 0644]
varnish-cache/bin/varnishtest/vtc_server.c

index 3bf14e7cb522da1e429f67e95ecc53b3e214e4c9..0d8c5b40ac8862345850c9178d98379beeabf6d1 100644 (file)
@@ -1,7 +1,7 @@
-# Test that we get anything through at all
+# Quis custodiet ipsos custodes?
 #
 
-server s1 -repeat 3 {
+server s1 -listen :9080 {
        rxreq
        expect url == "/"
        txresponse -body "0123456789"
@@ -9,67 +9,13 @@ server s1 -repeat 3 {
 
 server s1 -start 
 
-client c1 {
+client c1 -connect localhost:9080 {
        txreq -url "/"
        rxresponse
        expect status == 200
        expect length == 10
 }
 
-
-#######################################################################
-# Test trivial pipe mode
-
-vcl {
-       $s1;
-       sub vcl_recv {
-               set req.backend = s1;
-               pipe;
-       }
-}
-
-client c1 -run
-
-#######################################################################
-# Test trivial pass mode
-
-vcl {
-       $s1;
-       sub vcl_recv {
-               set req.backend = s1;
-               pass;
-       }
-}
-
-client c1 -run
-
-#######################################################################
-# Test trivial cache mode
-
-vcl {
-       $s1;
-       sub vcl_recv {
-               set req.backend = s1;
-       }
-}
-
 client c1 -run
 
 server s1 -wait
-
-#######################################################################
-# And see that it stuck in cache
-
-client c1 -run
-
-varnish stop
-
-stats {
-       expect client_conn == 4
-       expect client_req == 4
-       expect cache_hit == 1
-       expect cache_miss == 1
-       expect s_pipe == 1
-       expect s_pass == 1
-       expect s_fetch == 2
-}
diff --git a/varnish-cache/bin/varnishtest/t001.vtc b/varnish-cache/bin/varnishtest/t001.vtc
new file mode 100644 (file)
index 0000000..3bf14e7
--- /dev/null
@@ -0,0 +1,75 @@
+# Test that we get anything through at all
+#
+
+server s1 -repeat 3 {
+       rxreq
+       expect url == "/"
+       txresponse -body "0123456789"
+}
+
+server s1 -start 
+
+client c1 {
+       txreq -url "/"
+       rxresponse
+       expect status == 200
+       expect length == 10
+}
+
+
+#######################################################################
+# Test trivial pipe mode
+
+vcl {
+       $s1;
+       sub vcl_recv {
+               set req.backend = s1;
+               pipe;
+       }
+}
+
+client c1 -run
+
+#######################################################################
+# Test trivial pass mode
+
+vcl {
+       $s1;
+       sub vcl_recv {
+               set req.backend = s1;
+               pass;
+       }
+}
+
+client c1 -run
+
+#######################################################################
+# Test trivial cache mode
+
+vcl {
+       $s1;
+       sub vcl_recv {
+               set req.backend = s1;
+       }
+}
+
+client c1 -run
+
+server s1 -wait
+
+#######################################################################
+# And see that it stuck in cache
+
+client c1 -run
+
+varnish stop
+
+stats {
+       expect client_conn == 4
+       expect client_req == 4
+       expect cache_hit == 1
+       expect cache_miss == 1
+       expect s_pipe == 1
+       expect s_pass == 1
+       expect s_fetch == 2
+}
index 46de8b39bb5573b01cc240b46c0c543868ec6c07..56a0a0a354a73d8be7d8c77567e36af62f78f3e5 100644 (file)
@@ -170,6 +170,11 @@ cmd_server(char **av, void *priv)
                        av++;
                        continue;
                }
+               if (!strcmp(*av, "-listen")) {
+                       s->listen = av[1];
+                       av++;
+                       continue;
+               }
                if (!strcmp(*av, "-start")) {
                        server_start(s);
                        continue;