]> git.ipfire.org Git - thirdparty/pdns.git/blob - regression-tests.recursor-dnssec/runtests
Merge pull request #6496 from cyclops1982/3814
[thirdparty/pdns.git] / regression-tests.recursor-dnssec / runtests
1 #!/bin/sh
2
3 PYTHON=${PYTHON:-python2}
4
5 if [ ! -d .venv ]; then
6 virtualenv -p ${PYTHON} .venv
7 fi
8 . .venv/bin/activate
9 python -V
10 pip install -U pip
11 pip install -r requirements.txt
12
13 protoc -I=../pdns/ --python_out=. ../pdns/dnsmessage.proto
14 protoc -I=../pdns/ --python_out=. ../pdns/dnstap.proto
15
16
17 mkdir -p configs
18
19 [ -f ./vars ] && . ./vars
20
21 export PDNS=${PDNS:-${PWD}/../pdns/pdns_server}
22 export PDNSUTIL=${PDNSUTIL:-${PWD}/../pdns/pdnsutil}
23 export PDNSRECURSOR=${PDNSRECURSOR:-${PWD}/../pdns/recursordist/pdns_recursor}
24 export RECCONTROL=${RECCONTROL:-${PWD}/../pdns/recursordist/rec_control}
25
26 LIBFAKETIME_DEFAULT=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1 # ubuntu default
27 LIBAUTHBIND_DEFAULT=/usr/lib/authbind/libauthbind.so.1
28 if [ $(uname -s) = "Darwin" ]; then
29 # macOS is not /really/ supported here; it works for some tests, and then you might need sudo.
30 LIBFAKETIME_DEFAULT=/usr/local/lib/faketime/libfaketime.1.dylib
31 LIBAUTHBIND_DEFAULT=""
32 fi
33 if [ $(uname -s) = "OpenBSD" ]; then
34 # OpenBSD is not /really/ supported here; it works for some tests, and then you might need sudo.
35 LIBFAKETIME_DEFAULT=""
36 LIBAUTHBIND_DEFAULT=""
37 fi
38
39 export LIBFAKETIME=${LIBFAKETIME:-$LIBFAKETIME_DEFAULT}
40 export LIBAUTHBIND=${LIBAUTHBIND:-$LIBAUTHBIND_DEFAULT}
41
42 export PREFIX=127.0.0
43
44 for bin in "$PDNS" "$PDNSUTIL" "$PDNSRECURSOR" "$RECCONTROL" "$LIBFAKETIME" "$LIBAUTHBIND"; do
45 if [ -n "$bin" -a ! -e "$bin" ]; then
46 echo "E: Required binary $bin not found. Please install the binary and/or edit ./vars."
47 exit 1
48 fi
49 done
50
51 set -e
52 if [ "${PDNS_DEBUG}" = "YES" ]; then
53 set -x
54 fi
55
56 if ! "$PDNSRECURSOR" --version 2>&1 | grep Features | grep -q dnstap-framestream; then
57 export NODNSTAPTESTS=1
58 fi
59
60 if [ "${LIBAUTHBIND}" != "" -o "${LIBFAKETIME}" != "" ]; then
61 LD_PRELOAD="${LIBASAN} ${LIBAUTHBIND} ${LIBFAKETIME}" nosetests -I test_WellKnown.py --with-xunit $@
62 else
63 nosetests -I test_WellKnown.py --with-xunit $@
64 fi