[master] b5e64a9 Improve previous tests and add a few more

Federico G. Schwindt fgsch at lodoss.net
Wed Jan 11 00:12:04 CET 2017


commit b5e64a92d1f0d2d3e5017f1adf1baf4bfba6e89f
Author: Federico G. Schwindt <fgsch at lodoss.net>
Date:   Tue Jan 10 23:00:31 2017 +0000

    Improve previous tests and add a few more

diff --git a/bin/varnishtest/tests/u00005.vtc b/bin/varnishtest/tests/u00005.vtc
index b33fbe0..4905e09 100644
--- a/bin/varnishtest/tests/u00005.vtc
+++ b/bin/varnishtest/tests/u00005.vtc
@@ -8,9 +8,18 @@ server s1 {
 varnish v1 -vcl+backend {} -start
 
 process p1 "exec varnishstat -n ${v1_name} -h" -run
+shell {grep -q "Usage: varnishstat <options>" ${tmpdir}/p1/stderr}
 process p2 "exec varnishstat -n ${v1_name} -l" -run
+shell {grep -q "Varnishstat -f option fields:" ${tmpdir}/p2/stdout}
 process p3 "exec varnishstat -n ${v1_name} -V" -run
+shell {grep -q "Copyright (c) 2006 Verdens Gang AS" ${tmpdir}/p3/stderr}
 process p4 "exec varnishstat -n ${v1_name} -1" -run
+shell {grep -q "MAIN.uptime" ${tmpdir}/p4/stdout}
 process p5 "exec varnishstat -n ${v1_name} -x" -run
+shell {grep -q "<type>MAIN</type>" ${tmpdir}/p5/stdout}
 process p6 "exec varnishstat -n ${v1_name} -j" -run
+shell {grep -q "MAIN.uptime\":"  ${tmpdir}/p6/stdout}
 process p7 "exec varnishstat -n ${v1_name} extra" -run
+shell {grep -q "Usage: varnishstat <options>" ${tmpdir}/p7/stderr}
+process p8 "exec varnishstat -n /nonexistent" -run
+shell {grep -q "Cannot open /nonexistent/_.vsm" ${tmpdir}/p8/stderr}
diff --git a/bin/varnishtest/tests/u00006.vtc b/bin/varnishtest/tests/u00006.vtc
index d657b69..b30bbfd 100644
--- a/bin/varnishtest/tests/u00006.vtc
+++ b/bin/varnishtest/tests/u00006.vtc
@@ -8,7 +8,20 @@ server s1 {
 varnish v1 -vcl+backend {} -start
 
 process p1 "exec varnishlog -n ${v1_name} -g raw -k 1" -start
-process p2 "exec varnishlog -n ${v1_name} -h" -run
-process p3 "exec varnishlog -n ${v1_name} -V" -run
-process p4 "exec varnishlog -n ${v1_name} extra" -run
+process p2 {
+	exec varnishlog -n ${v1_name} -g raw -k 1 -w ${tmpdir}/p2/output -A
+} -start
+process p3 "exec varnishlog -n ${v1_name} -h" -run
+shell {grep -q "Usage: varnishlog <options>" ${tmpdir}/p3/stderr}
+process p4 "exec varnishlog -n ${v1_name} -V" -run
+shell {grep -q "Copyright (c) 2006 Verdens Gang AS" ${tmpdir}/p4/stderr}
+process p5 "exec varnishlog -n ${v1_name} extra" -run
+shell {grep -q "Usage: varnishlog <options>" ${tmpdir}/p5/stderr}
+process p6 "exec varnishlog -n ${v1_name} -D" -run
+shell {grep -q "Missing -w option" ${tmpdir}/p6/stderr}
+process p7 "exec varnishlog -n ${v1_name} -L 0" -run
+shell {grep -q -- "-L: Range error" ${tmpdir}/p7/stderr}
 process p1 -wait
+shell {grep -q "0 CLI" ${tmpdir}/p1/stdout}
+process p2 -wait
+shell {grep -q "0 CLI" ${tmpdir}/p2/output}



More information about the varnish-commit mailing list