]>
Commit | Line | Data |
---|---|---|
1 | #!/usr/bin/env bash | |
2 | set -e | |
3 | ||
4 | export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python | |
5 | ||
6 | if [ ! -d .venv ]; then | |
7 | python3 -m venv .venv | |
8 | fi | |
9 | . .venv/bin/activate | |
10 | python -V | |
11 | ||
12 | if [ `uname -s` == Darwin ] | |
13 | then | |
14 | if [ ! -e /usr/local/opt/curl-openssl ] | |
15 | then | |
16 | echo Please run: brew install curl-openssl, and try again | |
17 | exit 1 | |
18 | else | |
19 | export PYCURL_CURL_CONFIG=/usr/local/opt/curl-openssl/bin/curl-config | |
20 | export LDFLAGS=-L/usr/local/opt/openssl/lib | |
21 | export CPPFLAGS=-I/usr/local/opt/openssl/include | |
22 | fi | |
23 | fi | |
24 | pip install -U pip wheel | cat | |
25 | pip install -r requirements.txt | cat | |
26 | ||
27 | protoc -I=../pdns/ --python_out=. ../pdns/dnsmessage.proto | |
28 | protoc -I=../pdns/ --python_out=. ../pdns/dnstap.proto | |
29 | ||
30 | mkdir -p configs | |
31 | ||
32 | if [ -z "${DNSDISTBIN}" ]; then | |
33 | DNSDISTBIN=$(ls ../pdns/dnsdistdist/dnsdist-*/dnsdist) | |
34 | fi | |
35 | export DNSDISTBIN | |
36 | ||
37 | set -e | |
38 | if [ "${PDNS_DEBUG}" = "YES" ]; then | |
39 | set -x | |
40 | fi | |
41 | ||
42 | make clean-certs | |
43 | make clean-configs | |
44 | make certs | |
45 | ||
46 | out=$(mktemp) | |
47 | set -o pipefail | |
48 | if ! pytest --junitxml=pytest.xml --dist=loadfile -n auto $@ 2>&1 | tee "${out}" ; then | |
49 | for log in configs/*.log; do | |
50 | echo "=== ${log} ===" | |
51 | cat "${log}" | |
52 | echo | |
53 | done | |
54 | echo "=== pytest log ===" | |
55 | cat "${out}" | |
56 | echo "=== end of pytest log ===" | |
57 | false | |
58 | fi | |
59 | rm -f "${out}" | |
60 | ||
61 | make clean-certs |