]> git.ipfire.org Git - thirdparty/pdns.git/blame_incremental - regression-tests.dnsdist/runtests
dnsdist: Add regression tests for the new cache-miss rules chain
[thirdparty/pdns.git] / regression-tests.dnsdist / runtests
... / ...
CommitLineData
1#!/usr/bin/env bash
2set -e
3
4export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python
5
6if [ ! -d .venv ]; then
7 python3 -m venv .venv
8fi
9. .venv/bin/activate
10python -V
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
24pip install -U pip wheel | cat
25pip install -r requirements.txt | cat
26
27protoc -I=../pdns/ --python_out=. ../pdns/dnsmessage.proto
28protoc -I=../pdns/ --python_out=. ../pdns/dnstap.proto
29
30mkdir -p configs
31
32if [ -z "${DNSDISTBIN}" ]; then
33 DNSDISTBIN=$(ls ../pdns/dnsdistdist/dnsdist-*/dnsdist)
34fi
35export DNSDISTBIN
36
37set -e
38if [ "${PDNS_DEBUG}" = "YES" ]; then
39 set -x
40fi
41
42make clean-certs
43make clean-configs
44make certs
45
46out=$(mktemp)
47set -o pipefail
48if ! 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
58fi
59rm -f "${out}"
60
61make clean-certs