]> git.ipfire.org Git - thirdparty/pdns.git/blobdiff - regression-tests.api/runtests
dnsdist: Refactoring to merge the UDP and TCP paths
[thirdparty/pdns.git] / regression-tests.api / runtests
index 02c6c146082b7ee4671ec1e79a9541022f61a6a7..dac34dd10d5385c337bfd851518b07b9abdf258d 100755 (executable)
@@ -1,12 +1,24 @@
 #!/usr/bin/env bash
 
 if [ ! -d .venv ]; then
-       virtualenv -p python2 .venv
+  if [ -z "$PYTHON" ]; then
+    if [ ! -z "$(python3 --version | egrep '^Python 3.[6789]' 2>/dev/null)" ]; then
+      # found python3.6 or better
+      PYTHON=python3
+    else
+      # until we have better Linux distribution detection.
+      PYTHON=python2
+    fi
+  fi
+
+  virtualenv -p ${PYTHON} .venv
 fi
 . .venv/bin/activate
 python -V
 pip install -r requirements.txt
 
+export SDIG=$(type -P sdig)
+
 set -e
 if [ "${PDNS_DEBUG}" = "YES" ]; then
   set -x