[master] fcd983451 check for python before running the test

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Thu Apr 30 13:20:07 UTC 2020


commit fcd983451c52d284561de4534d4726e76c5314cf
Author: Guillaume Quintard <guillaume at varnish-software.com>
Date:   Mon Apr 20 10:00:50 2020 -0700

    check for python before running the test

diff --git a/bin/varnishtest/tests/u00015.vtc b/bin/varnishtest/tests/u00015.vtc
index 0a53593d3..7917bdae2 100644
--- a/bin/varnishtest/tests/u00015.vtc
+++ b/bin/varnishtest/tests/u00015.vtc
@@ -1,5 +1,7 @@
 varnishtest "varnishstat -j"
 
+feature cmd "python3 -c 'import json'"
+
 server s1 -repeat 5 {
 	rxreq
 	txresp
@@ -15,8 +17,5 @@ client c1 -repeat 5 {
 delay 1
 
 shell { varnishstat -n ${v1_name}  -j }
-## XXX:
-## - use @PYTHON@ discovered via autogen/automake
-## - make this test depend on json being available
-#shell -expect "1" { varnishstat -n ${v1_name} -j | python3 -c 'import sys, json; print(json.load(sys.stdin)["version"])' }
-#shell -expect "5" { varnishstat -n ${v1_name} -j | python3 -c 'import sys, json; print(json.load(sys.stdin)["counters"]["MAIN.client_req"]["value"])' }
+shell -match "^1$" { varnishstat -n ${v1_name} -j | python3 -c 'import sys, json; print(json.load(sys.stdin)["version"])' }
+shell -match "^5$" { varnishstat -n ${v1_name} -j | python3 -c 'import sys, json; print(json.load(sys.stdin)["counters"]["MAIN.client_req"]["value"])' }


More information about the varnish-commit mailing list