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