]> granicus.if.org Git - pdns/commitdiff
regression-tests.recursor-dnssec: make this somewhat usable on macOS
authorChris Hofstaedtler <chris.hofstaedtler@deduktiva.com>
Mon, 27 Nov 2017 14:09:10 +0000 (15:09 +0100)
committerChris Hofstaedtler <chris.hofstaedtler@deduktiva.com>
Sun, 10 Dec 2017 12:35:43 +0000 (13:35 +0100)
regression-tests.recursor-dnssec/runtests

index 840b045f93b4d489476e508fc5f2d4bdf6d70d07..9682f92eb63e31bb7fa610bf117f16a5b90ee141 100755 (executable)
@@ -17,13 +17,29 @@ export PDNS=${PDNS:-${PWD}/../pdns/pdns_server}
 export PDNSUTIL=${PDNSUTIL:-${PWD}/../pdns/pdnsutil}
 export PDNSRECURSOR=${PDNSRECURSOR:-${PWD}/../pdns/recursordist/pdns_recursor}
 export RECCONTROL=${RECCONTROL:-${PWD}/../pdns/recursordist/rec_control}
-export LIBFAKETIME=${LIBFAKETIME:-/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1} # ubuntu default
+
+LIBFAKETIME_DEFAULT=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1 # ubuntu default
+LIBAUTHBIND_DEFAULT=/usr/lib/authbind/libauthbind.so.1
+if [ $(uname -s) = "Darwin" ]; then
+  # macOS is not /really/ supported here; it works for some tests, and then you might need sudo.
+  LIBFAKETIME_DEFAULT=/usr/local/lib/faketime/libfaketime.1.dylib
+  LIBAUTHBIND_DEFAULT=""
+fi
+
+export LIBFAKETIME=${LIBFAKETIME:-$LIBFAKETIME_DEFAULT}
+export LIBAUTHBIND=${LIBAUTHBIND:-$LIBAUTHBIND_DEFAULT}
 
 export PREFIX=127.0.0
 
+for bin in "$PDNS" "$PDNSUTIL" "$PDNSRECURSOR" "$RECCONTROL" "$LIBFAKETIME" "$LIBAUTHBIND"; do
+  if [ -n "$bin" -a ! -e "$bin" ]; then
+    echo "E: Required binary $bin not found. Please install the binary and/or edit ./vars."
+    exit 1
+  fi
+done
 
 set -e
 if [ "${PDNS_DEBUG}" = "YES" ]; then
   set -x
 fi
-LD_PRELOAD="/usr/lib/authbind/libauthbind.so.1 ${LIBFAKETIME}" nosetests -I test_WellKnown.py --with-xunit $@
+LD_PRELOAD="${LIBAUTHBIND} ${LIBFAKETIME}" nosetests -I test_WellKnown.py --with-xunit $@