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