]> git.ipfire.org Git - thirdparty/pdns.git/blob - regression-tests.recursor-dnssec/runtests
Merge pull request #13743 from Habbie/auth-api-priority-error
[thirdparty/pdns.git] / regression-tests.recursor-dnssec / runtests
1 #!/bin/sh
2
3 export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python
4
5 if [ ! -d .venv ]; then
6 python3 -m venv .venv
7 fi
8 . .venv/bin/activate
9 python -V
10 pip install -U pip | cat
11 pip install -r requirements.txt | cat
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/libfaketimeMT.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 # LIBFAKETIME is only added to LD_PRELOAD by the pyton code when needed
61 if [ "${LIBASAN}" != "" -o "${LIBAUTHBIND}" != "" ]; then
62 LD_PRELOAD="${LIBASAN} ${LIBAUTHBIND}" pytest --ignore=test_WellKnown.py --junitxml=pytest.xml $@
63 else
64 pytest --ignore=test_WellKnown.py --junitxml=pytest.xml $@
65 fi