From: Chris Hofstaedtler Date: Mon, 8 Jan 2018 15:32:20 +0000 (+0100) Subject: tests: use sdig from PATH if available X-Git-Tag: dnsdist-1.3.0~113^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0567c609dbe8f4da5702534baf56f2951c45d554;p=pdns tests: use sdig from PATH if available --- diff --git a/regression-tests.api/runtests b/regression-tests.api/runtests index beee380d3..47f25f0f1 100755 --- a/regression-tests.api/runtests +++ b/regression-tests.api/runtests @@ -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 diff --git a/regression-tests.api/runtests.py b/regression-tests.api/runtests.py index 7f17a8183..8332fa465 100755 --- a/regression-tests.api/runtests.py +++ b/regression-tests.api/runtests.py @@ -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