]>
Commit | Line | Data |
---|---|---|
7568b07d PL |
1 | #!/bin/sh |
2 | ||
3 | if [ ! -d .venv ]; then | |
98508251 | 4 | python3 -m venv .venv |
7568b07d PL |
5 | fi |
6 | . .venv/bin/activate | |
7 | python -V | |
38a3b7c0 OM |
8 | pip install -U pip | cat |
9 | pip install -r requirements.txt | cat | |
7568b07d | 10 | |
f1c7929a | 11 | protoc -I=../pdns/ --python_out=. ../pdns/dnsmessage.proto |
fc7f729f OM |
12 | protoc -I=../pdns/ --python_out=. ../pdns/dnstap.proto |
13 | ||
f1c7929a | 14 | |
7568b07d PL |
15 | mkdir -p configs |
16 | ||
cb54e9b5 PL |
17 | [ -f ./vars ] && . ./vars |
18 | ||
7568b07d PL |
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} | |
025d939d | 23 | |
6f1a3e76 | 24 | LIBFAKETIME_DEFAULT=/usr/lib/x86_64-linux-gnu/faketime/libfaketimeMT.so.1 # ubuntu default |
025d939d CH |
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 | |
fc7f729f OM |
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 | |
025d939d CH |
36 | |
37 | export LIBFAKETIME=${LIBFAKETIME:-$LIBFAKETIME_DEFAULT} | |
38 | export LIBAUTHBIND=${LIBAUTHBIND:-$LIBAUTHBIND_DEFAULT} | |
7568b07d | 39 | |
05a91e33 | 40 | export PREFIX=127.0.0 |
7568b07d | 41 | |
025d939d CH |
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 | |
cb54e9b5 | 48 | |
7568b07d PL |
49 | set -e |
50 | if [ "${PDNS_DEBUG}" = "YES" ]; then | |
51 | set -x | |
52 | fi | |
fc7f729f OM |
53 | |
54 | if ! "$PDNSRECURSOR" --version 2>&1 | grep Features | grep -q dnstap-framestream; then | |
55 | export NODNSTAPTESTS=1 | |
56 | fi | |
57 | ||
6f1a3e76 OM |
58 | # LIBFAKETIME is only added to LD_PRELOAD by the pyton code when needed |
59 | if [ "${LIBASAN}" != "" -o "${LIBAUTHBIND}" != "" ]; then | |
60 | LD_PRELOAD="${LIBASAN} ${LIBAUTHBIND}" nosetests -I test_WellKnown.py --with-xunit $@ | |
fc7f729f OM |
61 | else |
62 | nosetests -I test_WellKnown.py --with-xunit $@ | |
63 | fi |