]> granicus.if.org Git - pdns/commitdiff
tests: use sdig from PATH if available
authorChris Hofstaedtler <chris.hofstaedtler@deduktiva.com>
Mon, 8 Jan 2018 15:32:20 +0000 (16:32 +0100)
committerChris Hofstaedtler <chris.hofstaedtler@deduktiva.com>
Mon, 8 Jan 2018 15:32:20 +0000 (16:32 +0100)
regression-tests.api/runtests
regression-tests.api/runtests.py

index beee380d3166cd7542cd6a592843c39002e94d2b..47f25f0f12c6a0838980bb8836613f1c5b435622 100755 (executable)
@@ -9,6 +9,8 @@ fi
 python -V
 pip install -r requirements.txt
 
+export SDIG=$(type -P sdig)
+
 set -e
 if [ "${PDNS_DEBUG}" = "YES" ]; then
   set -x
index 7f17a81831a5c74ade737ab5748faa22f0839b6c..8332fa465639a5cd18fbc6e26b7a5457486ed09c 100755 (executable)
@@ -100,7 +100,14 @@ common_args = [
     "--api-key="+APIKEY
 ]
 
-run_check_call(["make", "-C", "../pdns", "sdig"])
+# Take sdig if it exists (recursor in travis), otherwise build it from Authoritative source.
+sdig = os.environ.get("SDIG", "")
+if sdig:
+    sdig = os.path.abspath(sdig)
+if not sdig or not os.path.exists(sdig):
+    run_check_call(["make", "-C", "../pdns", "sdig"])
+    sdig = "../pdns/sdig"
+
 
 if daemon == 'authoritative':
 
@@ -165,7 +172,7 @@ if not available:
     sys.exit(2)
 
 print "Query for example.com/A to create statistic data..."
-run_check_call(["../pdns/sdig", "127.0.0.1", str(DNSPORT), "example.com", "A"])
+run_check_call([sdig, "127.0.0.1", str(DNSPORT), "example.com", "A"])
 
 print "Running tests..."
 returncode = 0