[6.0] 9e77fc812 Add some testing bits for VSL -R

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Fri Feb 8 12:31:13 UTC 2019


commit 9e77fc8121bf58c4d3cffae4b14c92352c2e495e
Author: Dag Haavi Finstad <daghf at varnish-software.com>
Date:   Mon Dec 3 11:39:42 2018 +0100

    Add some testing bits for VSL -R

diff --git a/bin/varnishtest/tests/u00003.vtc b/bin/varnishtest/tests/u00003.vtc
index e18d9b912..cd4a4880a 100644
--- a/bin/varnishtest/tests/u00003.vtc
+++ b/bin/varnishtest/tests/u00003.vtc
@@ -26,7 +26,7 @@ varnish v1 -vcl+backend {
 
 shell {
 	varnishncsa -n ${v1_name} -D -P ${tmpdir}/ncsa.pid \
-		-w ${tmpdir}/ncsa.log
+		-w ${tmpdir}/ncsa.log -R 100/s
 }
 
 delay 1
diff --git a/bin/varnishtest/tests/u00006.vtc b/bin/varnishtest/tests/u00006.vtc
index 2f648ab8f..9ffb331e7 100644
--- a/bin/varnishtest/tests/u00006.vtc
+++ b/bin/varnishtest/tests/u00006.vtc
@@ -12,7 +12,7 @@ process p1 {
 } -start
 shell {
 	exec varnishlog -n ${v1_name} -D -P ${tmpdir}/vlog.pid \
-	    -w ${tmpdir}/vlog.bin
+	    -w ${tmpdir}/vlog.bin -R 10/s
 }
 
 shell -match "Usage: .*varnishlog <options>" \
@@ -79,6 +79,25 @@ shell -err -expect "Expected integer got ']'" \
 shell -err -expect "Expected positive integer" \
 	{varnishlog -q "ReqHeader:foo[a]"}
 
+shell -err -expect "-R: Syntax error" \
+	"varnishlog -R 1foo"
+shell -err -expect "-R: Range error" \
+	"varnishlog -R 0"
+shell -err -expect "-R: Range error" \
+	"varnishlog -R -1"
+shell -err -expect "-R: Range error" \
+	"varnishlog -R 3000000000"
+shell -err -expect "-R: Syntax error: Invalid duration" \
+	"varnishlog -R 10/0s"
+shell -err -expect "-R: Syntax error: Invalid duration" \
+	"varnishlog -R 10/-10s"
+shell -err -expect "-R: Syntax error: Invalid duration" \
+	"varnishlog -R 10/1q"
+shell -err -expect "-R: Syntax error: Invalid duration" \
+	"varnishlog -R 10/11f09s"
+shell -err -expect "-R: Syntax error" \
+	"varnishlog -R 1000000000/1000000000000000000000000000000s"
+
 process p1 -wait
 shell {grep -q "0 CLI" ${tmpdir}/vlog}
 shell -match "0 CLI[ ]+- Wr 200 [0-9]+ PONG" \


More information about the varnish-commit mailing list