[master] fbe0489 More coverage

Federico G. Schwindt fgsch at lodoss.net
Mon Jan 23 02:49:05 CET 2017


commit fbe04890b22843bb9c98fc1007e9d7ae3aa19904
Author: Federico G. Schwindt <fgsch at lodoss.net>
Date:   Mon Jan 23 01:48:13 2017 +0000

    More coverage

diff --git a/bin/varnishtest/tests/u00003.vtc b/bin/varnishtest/tests/u00003.vtc
index 6369e45..2f4e188 100644
--- a/bin/varnishtest/tests/u00003.vtc
+++ b/bin/varnishtest/tests/u00003.vtc
@@ -5,9 +5,17 @@ server s1 -repeat 2 {
 	txresp
 } -start
 
-varnish v1 -vcl+backend {} -start
+varnish v1 -vcl+backend {
+	import std;
+	sub vcl_backend_fetch {
+		std.log("foo:qux");
+	}
+} -start
 
-shell "varnishncsa -n ${v1_name} -D -P ${tmpdir}/ncsa.pid -w ${tmpdir}/ncsa.log"
+shell {
+	varnishncsa -n ${v1_name} -D -P ${tmpdir}/ncsa.pid \
+		-w ${tmpdir}/ncsa.log
+}
 
 shell -expect "Usage: varnishncsa <options>" \
 	"varnishncsa -h"
@@ -74,6 +82,8 @@ shell "kill `cat ${tmpdir}/ncsa.pid`"
 shell "grep -q /foo ${tmpdir}/ncsa.old.log"
 shell "grep -q /bar ${tmpdir}/ncsa.log"
 
-shell {echo "%{VSL:Begin}x %{Varnish:vxid}x %D %T %{Varnish:handling}x %{%Z}t" >${tmpdir}/format}
-shell -match "req 1000 rxreq 1001 [0-9]{5} 0 miss [A-Z]{3,}" \
+shell {echo "%{VSL:Begin}x %{Varnish:vxid}x %{VCL_Log:foo}x %D %T %{Varnish:handling}x %{%Z}t" >${tmpdir}/format}
+shell -match "^req 1000 rxreq 1001  [0-9]{5} 0 miss [A-Z]{3,}" \
 	{varnishncsa -n ${v1_name} -d -f ${tmpdir}/format}
+shell -match "^bereq 1001 fetch 1002 qux [0-9]{5} 0 - [A-Z]{3,}" \
+	{varnishncsa -n ${v1_name} -d -f ${tmpdir}/format -b}
diff --git a/bin/varnishtest/tests/u00004.vtc b/bin/varnishtest/tests/u00004.vtc
index 046b1f0..811b370 100644
--- a/bin/varnishtest/tests/u00004.vtc
+++ b/bin/varnishtest/tests/u00004.vtc
@@ -5,15 +5,18 @@ server s1 {
 	txresp
 } -start
 
-varnish v1 -vcl+backend "" -start
-
-process p1 {exec varnishtop -1 -n ${v1_name} >/dev/null} -start
+varnish v1 -vcl+backend { } -start
 
 client c1 {
 	txreq
 	rxresp
 } -run
 
-process p1 -wait
+shell -expect "fetch" "varnishtop -n ${v1_name} -1 -d"
 
-process p2 {exec varnishtop -1 -n ${v1_name} >/dev/null} -run
+shell -expect "Usage: varnishtop <options>" \
+	"varnishtop -h"
+shell -expect "Copyright (c) 2006 Verdens Gang AS" \
+	"varnishtop -V"
+shell -err -expect "Usage: varnishtop <options>" \
+	"varnishtop extra"
diff --git a/bin/varnishtest/tests/u00006.vtc b/bin/varnishtest/tests/u00006.vtc
index cda5d73..9b6f83f 100644
--- a/bin/varnishtest/tests/u00006.vtc
+++ b/bin/varnishtest/tests/u00006.vtc
@@ -71,3 +71,8 @@ $} {
 }
 shell -match "-[ ]+BereqURL[ ]+/bar" \
 	"varnishlog -r ${tmpdir}/vlog.bin -x ReqURL"
+shell -match {^\*[ ]+<< BeReq\s+>>[ ]+1005[ ]+
+-[ ]+BereqURL[ ]+/bar
+$} {
+	varnishlog -r ${tmpdir}/vlog.bin -b -C -I BAR
+}
diff --git a/bin/varnishtest/tests/u00007.vtc b/bin/varnishtest/tests/u00007.vtc
index b1bd0a2..80d956c 100644
--- a/bin/varnishtest/tests/u00007.vtc
+++ b/bin/varnishtest/tests/u00007.vtc
@@ -9,6 +9,8 @@ varnish v1 -vcl+backend {} -start
 
 shell -expect "Usage: varnishhist <options>" \
 	"varnishhist -h"
+shell -expect "Copyright (c) 2006 Verdens Gang AS" \
+	"varnishhist -V"
 shell -err -expect "Usage: varnishhist <options>" \
 	"varnishhist extra"
 shell -err -expect "-p: invalid '0'" \



More information about the varnish-commit mailing list