[master] f6a1111 More improvements and additions
Federico G. Schwindt
fgsch at lodoss.net
Wed Jan 11 21:04:04 CET 2017
commit f6a1111e03d1ea67fb5fd254d48826e72f06545c
Author: Federico G. Schwindt <fgsch at lodoss.net>
Date: Wed Jan 11 19:56:55 2017 +0000
More improvements and additions
diff --git a/bin/varnishtest/tests/u00003.vtc b/bin/varnishtest/tests/u00003.vtc
index 14a54c4..1c84887 100644
--- a/bin/varnishtest/tests/u00003.vtc
+++ b/bin/varnishtest/tests/u00003.vtc
@@ -1,4 +1,4 @@
-varnishtest "varnishncsa -F error handling"
+varnishtest "varnishncsa error handling"
server s1 {
rxreq
@@ -7,6 +7,18 @@ server s1 {
varnish v1 -vcl+backend {} -start
+err_shell "Missing -w option" \
+ {varnishncsa -n ${v1_name} -D 2>&1}
+
+err_shell "Unknown format specifier at: %{foo}A" \
+ {varnishncsa -n ${v1_name} -F "%{foo}A" 2>&1}
+
+err_shell "Unknown format specifier at: %A" \
+ {varnishncsa -n ${v1_name} -F "%A" 2>&1}
+
+err_shell "Usage: varnishncsa <options>" \
+ {varnishncsa -n ${v1_name} extra 2>&1}
+
err_shell "Missing tag in VSL:" \
{varnishncsa -n ${v1_name} -F "%{VSL:}x" 2>&1}
diff --git a/bin/varnishtest/tests/u00005.vtc b/bin/varnishtest/tests/u00005.vtc
index 4905e09..d6b0dd4 100644
--- a/bin/varnishtest/tests/u00005.vtc
+++ b/bin/varnishtest/tests/u00005.vtc
@@ -19,7 +19,5 @@ 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}
+err_shell "Usage: varnishstat <options>" "varnishstat -n ${v1_name} extra 2>&1"
+err_shell "Cannot open /nonexistent/_.vsm" "varnishstat -n /nonexistent 2>&1"
diff --git a/bin/varnishtest/tests/u00006.vtc b/bin/varnishtest/tests/u00006.vtc
index b30bbfd..8f49e75 100644
--- a/bin/varnishtest/tests/u00006.vtc
+++ b/bin/varnishtest/tests/u00006.vtc
@@ -11,17 +11,19 @@ process p1 "exec varnishlog -n ${v1_name} -g raw -k 1" -start
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 p3 {
+ exec varnishlog -n ${v1_name} -g raw -k 1 -w ${tmpdir}/p3/output.bin
+} -start
+process p4 "exec varnishlog -n ${v1_name} -h" -run
+shell {grep -q "Usage: varnishlog <options>" ${tmpdir}/p4/stderr}
+process p5 "exec varnishlog -n ${v1_name} -V" -run
+shell {grep -q "Copyright (c) 2006 Verdens Gang AS" ${tmpdir}/p5/stderr}
+err_shell "Usage: varnishlog <options>" "varnishlog -n ${v1_name} extra 2>&1"
+err_shell "Missing -w option" "varnishlog -n ${v1_name} -D 2>&1"
+err_shell "-L: Range error" "varnishlog -n ${v1_name} -L 0 2>&1"
process p1 -wait
shell {grep -q "0 CLI" ${tmpdir}/p1/stdout}
process p2 -wait
shell {grep -q "0 CLI" ${tmpdir}/p2/output}
+process p3 -wait
+shell {varnishlog -g raw -r ${tmpdir}/p3/output.bin | grep -q "0 CLI"}
More information about the varnish-commit
mailing list