[master] ae60839 Split this test in two, A9 was getting too many C-compiler invocations for the gcov vtester to finish in 60 seconds.

Poul-Henning Kamp phk at FreeBSD.org
Fri Mar 10 13:31:05 CET 2017


commit ae60839616f099c80237720498bed4fa23ae0eba
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Fri Mar 10 12:29:56 2017 +0000

    Split this test in two, A9 was getting too many C-compiler invocations
    for the gcov vtester to finish in 60 seconds.

diff --git a/bin/varnishtest/tests/a00009.vtc b/bin/varnishtest/tests/a00009.vtc
index f6e2a39..abe4c85 100644
--- a/bin/varnishtest/tests/a00009.vtc
+++ b/bin/varnishtest/tests/a00009.vtc
@@ -5,101 +5,45 @@ shell -err -expect {VCL version declaration missing} {
 	echo 'bad vcl' > ${tmpdir}/bad.vcl
 	varnishd -f ${tmpdir}/bad.vcl -n ${tmpdir}
 }
-shell -err -expect {VCL version declaration missing} {
-	echo 'bad vcl' > ${tmpdir}/bad.vcl
-	varnishd -C -f ${tmpdir}/bad.vcl -n ${tmpdir}
-}
-shell -err -expect {-spersistent has been deprecated} "varnishd -spersistent -f '' "
-shell -err -expect {Unknown jail method "xyz"} "varnishd -jxyz -f '' "
 
 shell -err -expect {-x must be the first argument} "varnishd -d -x foo "
+shell -err -expect {-V must be the first argument} "varnishd -d -V foo "
+
 shell -err -expect {Too many arguments for -x} "varnishd -x foo bar"
 shell -err -expect {Invalid -x argument} "varnishd -x foo "
+shell -err -expect {Option 'A' unknown.} "varnishd -A "
+shell -err -expect {Usage: varnishd [options]} "varnishd -? "
+shell -err -expect {Too many arguments} "varnishd foo "
+
 shell "varnishd -x parameter > ${tmpdir}/_.param"
 shell "varnishd -x vsl > ${tmpdir}/_.vsl"
 shell "varnishd -x cli > ${tmpdir}/_.cli"
 shell "varnishd -x builtin > ${tmpdir}/_.builtin"
 
-shell -err -expect {-V must be the first argument} "varnishd -d -V foo "
-shell -err -expect {Too many arguments for -V} "varnishd -V -V"
-shell -expect {Copyright (c) 2006} "varnishd -V"
-
-shell -err -expect {Too many arguments} "varnishd foo "
-shell -err -expect {Only one of -d or -F can be specified} "varnishd -d -F "
-shell -err -expect {Only one of -b or -f can be specified} "varnishd -b a -f b "
-shell -err -expect {-C needs either -b <backend> or -f <vcl_file>} \
-	"varnishd -C "
-shell -err -expect {-d makes no sense with -C} "varnishd -C -b 127.0.0.1:80 -d "
-shell -err -expect {-F makes no sense with -C} "varnishd -C -b 127.0.0.1:80 -F "
-shell -err -expect {Usage: varnishd [options]} "varnishd -? "
-shell -err -expect {Invalid backslash sequence} {varnishd -l 'xyz\kk,xyz\foo' -f '' }
-shell -err -expect {Invalid backslash sequence} {varnishd -l 'ab\8cd' -f '' }
-shell -err -expect {Option 'A' unknown.} "varnishd -A "
-shell -err -expect {Cannot open -S file} {
-	varnishd -S ${tmpdir}/nonexistent -n ${tmpdir}/v0 -f ''
+shell -err -expect {-spersistent has been deprecated} {
+	varnishd -spersistent -f ''
 }
-shell -err -expect {Neither -b nor -f given} { varnishd -n ${tmpdir}/v0  }
 
-# Test -F mode with no VCL loaded
-
-process p1 "exec varnishd -n ${tmpdir}/v1 -F -f '' -a :0 -l2m,1m" -log -start
-
-delay 2
-
-shell {
-	(
-	echo 'vcl 4.0;'
-	echo 'backend default {'
-	echo '  .host="${bad_backend}";'
-	echo '}'
-	) > ${tmpdir}/vcl
+shell -err -expect {-C needs either -b <backend> or -f <vcl_file>} {
+	varnishd -C
 }
-
-shell -expect {VCL compiled.} {
-	varnishadm -n ${tmpdir}/v1 vcl.load vcl1 ${tmpdir}/vcl
+shell -err -expect {Cannot open -S file} {
+	varnishd -S ${tmpdir}/nonexistent -n ${tmpdir}/v0 -f ''
 }
+shell -err -expect {Unknown jail method "xyz"} "varnishd -jxyz -f '' "
 
-shell -expect {active      auto/warm          - vcl1} {
-	varnishadm -n ${tmpdir}/v1 vcl.list
+shell -err -expect {Invalid backslash sequence} {
+	varnishd -l 'xyz\kk,xyz\foo' -f ''
 }
-
-shell {varnishadm -n ${tmpdir}/v1 start}
-
-shell {varnishadm -n ${tmpdir}/v1 debug.listen_address}
-
-process p1 -stop -wait
-
-# Test multiple -f options
-
-shell {
-	cat >${tmpdir}/ok1 <<-EOF
-	vcl 4.0;
-	backend ok1 {
-	  .host="${bad_backend}";
-	}
-	EOF
-
-	cat >${tmpdir}/ok2 <<-EOF
-	vcl 4.0;
-	backend ok2 {
-	  .host="${bad_backend}";
-	}
-	EOF
+shell -err -expect {Invalid backslash sequence} {
+	varnishd -l 'ab\8cd' -f ''
 }
+shell -err -expect {Too many arguments for -V} "varnishd -V -V"
+shell -expect {Copyright (c) 2006} "varnishd -V"
 
-varnish v2 -arg "-f ${tmpdir}/ok1" -arg "-f ${tmpdir}/ok2" -start
-varnish v2 -cliexpect {available *auto/warm *0 boot0} "vcl.list"
-varnish v2 -cliexpect {active *auto/warm *0 boot} "vcl.list"
-varnish v2 -stop -wait
-
-# Test multiple -f options with a bad VCL
-
-shell -err -expect {Cannot read -f file} {
-	exec varnishd -n ${tmpdir}/v0 -F -a :0 -l2m,3m -f ${tmpdir}/ok1 \
-	    -f ${tmpdir}/ok2 -f ${tmpdir}/bad
-}
+shell -err -expect {Only one of -d or -F can be specified} "varnishd -d -F "
+shell -err -expect {Only one of -b or -f can be specified} "varnishd -b a -f b "
+shell -err -expect {-d makes no sense with -C} "varnishd -C -b 127.0.0.1:80 -d "
+shell -err -expect {-F makes no sense with -C} "varnishd -C -b 127.0.0.1:80 -F "
+shell -err -expect {Neither -b nor -f given} { varnishd -n ${tmpdir}/v0  }
 
-shell -err -expect {Cannot read -f file} {
-	exec varnishd -n ${tmpdir}/v0 -F -a :0 -l2m,3m -f ${tmpdir}/ok1 \
-	    -f ${tmpdir}/bad -f ${tmpdir}/ok2
-}
diff --git a/bin/varnishtest/tests/a00017.vtc b/bin/varnishtest/tests/a00017.vtc
new file mode 100644
index 0000000..1a3538b
--- /dev/null
+++ b/bin/varnishtest/tests/a00017.vtc
@@ -0,0 +1,65 @@
+varnishtest "Code coverage of mgt_main, (VCL compiler and RSTdump etc)"
+
+# Test -F mode with no VCL loaded
+
+process p1 "exec varnishd -n ${tmpdir}/v1 -F -f '' -a :0 -l2m,1m" -log -start
+
+delay 2
+
+shell {
+	(
+	echo 'vcl 4.0;'
+	echo 'backend default {'
+	echo '  .host="${bad_backend}";'
+	echo '}'
+	) > ${tmpdir}/vcl
+}
+
+shell -expect {VCL compiled.} {
+	varnishadm -n ${tmpdir}/v1 vcl.load vcl1 ${tmpdir}/vcl
+}
+
+shell -expect {active      auto/warm          - vcl1} {
+	varnishadm -n ${tmpdir}/v1 vcl.list
+}
+
+shell {varnishadm -n ${tmpdir}/v1 start}
+
+shell {varnishadm -n ${tmpdir}/v1 debug.listen_address}
+
+process p1 -stop -wait
+
+# Test multiple -f options
+
+shell {
+	cat >${tmpdir}/ok1 <<-EOF
+	vcl 4.0;
+	backend ok1 {
+	  .host="${bad_backend}";
+	}
+	EOF
+
+	cat >${tmpdir}/ok2 <<-EOF
+	vcl 4.0;
+	backend ok2 {
+	  .host="${bad_backend}";
+	}
+	EOF
+}
+
+varnish v2 -arg "-f ${tmpdir}/ok1" -arg "-f ${tmpdir}/ok2" -start
+varnish v2 -cliexpect {available *auto/warm *0 boot0} "vcl.list"
+varnish v2 -cliexpect {active *auto/warm *0 boot} "vcl.list"
+varnish v2 -stop -wait
+
+# Test multiple -f options with a bad VCL
+
+shell -err -expect {Cannot read -f file} {
+	exec varnishd -n ${tmpdir}/v0 -F -a :0 -l2m,3m -f ${tmpdir}/ok1 \
+	    -f ${tmpdir}/ok2 -f ${tmpdir}/bad
+}
+
+shell -err -expect {Cannot read -f file} {
+	exec varnishd -n ${tmpdir}/v0 -F -a :0 -l2m,3m -f ${tmpdir}/ok1 \
+	    -f ${tmpdir}/bad -f ${tmpdir}/ok2
+}



More information about the varnish-commit mailing list