]> git.ipfire.org Git - thirdparty/pdns.git/blame - regression-tests.dnsdist/runtests
dnsdist: Add regression tests for the new cache-miss rules chain
[thirdparty/pdns.git] / regression-tests.dnsdist / runtests
CommitLineData
ca404e94 1#!/usr/bin/env bash
ef5a5c88
PD
2set -e
3
2dd4d60b
PD
4export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python
5
ca404e94 6if [ ! -d .venv ]; then
98508251 7 python3 -m venv .venv
ca404e94
RG
8fi
9. .venv/bin/activate
10python -V
4e144f1d
PD
11
12if [ `uname -s` == Darwin ]
13then
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
23fi
ba0b1412 24pip install -U pip wheel | cat
38a3b7c0 25pip install -r requirements.txt | cat
4e144f1d 26
1d0bd88a 27protoc -I=../pdns/ --python_out=. ../pdns/dnsmessage.proto
82a91ddf 28protoc -I=../pdns/ --python_out=. ../pdns/dnstap.proto
ca404e94 29
aac2124b
RG
30mkdir -p configs
31
ca404e94 32if [ -z "${DNSDISTBIN}" ]; then
b4f23783 33 DNSDISTBIN=$(ls ../pdns/dnsdistdist/dnsdist-*/dnsdist)
ca404e94
RG
34fi
35export DNSDISTBIN
36
37set -e
9091cf89
PL
38if [ "${PDNS_DEBUG}" = "YES" ]; then
39 set -x
40fi
a227f47d 41
995a5b9b
RG
42make clean-certs
43make clean-configs
44make certs
a227f47d 45
f3853a40
O
46out=$(mktemp)
47set -o pipefail
630eb526 48if ! pytest --junitxml=pytest.xml --dist=loadfile -n auto $@ 2>&1 | tee "${out}" ; then
aac2124b
RG
49 for log in configs/*.log; do
50 echo "=== ${log} ==="
51 cat "${log}"
f3853a40 52 echo
aac2124b 53 done
630eb526 54 echo "=== pytest log ==="
f3853a40 55 cat "${out}"
630eb526 56 echo "=== end of pytest log ==="
aac2124b
RG
57 false
58fi
f3853a40 59rm -f "${out}"
a227f47d 60
995a5b9b 61make clean-certs