]> git.ipfire.org Git - thirdparty/pdns.git/blame - regression-tests.dnsdist/runtests
Merge pull request #8713 from rgacogne/auth-strict-caches-size
[thirdparty/pdns.git] / regression-tests.dnsdist / runtests
CommitLineData
ca404e94 1#!/usr/bin/env bash
ef5a5c88
PD
2set -e
3
ca404e94 4if [ ! -d .venv ]; then
b4f23783
CH
5 if [ -z "$PYTHON" ]; then
6 if [ ! -z "$(python3 --version | egrep '^Python 3.[6789]' 2>/dev/null)" ]; then
7 # found python3.6 or better
8 PYTHON=python3
9 else
10 # until we have better Linux distribution detection.
11 PYTHON=python2
12 fi
13 fi
14
15 virtualenv -p ${PYTHON} .venv
ca404e94
RG
16fi
17. .venv/bin/activate
18python -V
4e144f1d
PD
19
20if [ `uname -s` == Darwin ]
21then
22 if [ ! -e /usr/local/opt/curl-openssl ]
23 then
24 echo Please run: brew install curl-openssl, and try again
25 exit 1
26 else
27 export PYCURL_CURL_CONFIG=/usr/local/opt/curl-openssl/bin/curl-config
28 export LDFLAGS=-L/usr/local/opt/openssl/lib
29 export CPPFLAGS=-I/usr/local/opt/openssl/include
30 fi
31fi
38a3b7c0 32pip install -r requirements.txt | cat
4e144f1d 33
1d0bd88a 34protoc -I=../pdns/ --python_out=. ../pdns/dnsmessage.proto
82a91ddf 35protoc -I=../pdns/ --python_out=. ../pdns/dnstap.proto
ca404e94 36
aac2124b
RG
37mkdir -p configs
38
ca404e94 39if [ -z "${DNSDISTBIN}" ]; then
b4f23783 40 DNSDISTBIN=$(ls ../pdns/dnsdistdist/dnsdist-*/dnsdist)
ca404e94
RG
41fi
42export DNSDISTBIN
43
44set -e
9091cf89
PL
45if [ "${PDNS_DEBUG}" = "YES" ]; then
46 set -x
47fi
a227f47d 48
8c15553e 49rm -f ca.key ca.pem ca.srl server.csr server.key server.pem server.chain server.ocsp
c8f3da74
OM
50rm -rf configs/*
51
a227f47d
RG
52# Generate a new CA
53openssl req -new -x509 -days 1 -extensions v3_ca -keyout ca.key -out ca.pem -nodes -config configCA.conf
54# Generate a new server certificate request
55openssl req -new -newkey rsa:2048 -nodes -keyout server.key -out server.csr -config configServer.conf
56# Sign the server cert
046bac5c 57openssl x509 -req -days 1 -CA ca.pem -CAkey ca.key -CAcreateserial -in server.csr -out server.pem -extfile configServer.conf -extensions v3_req
a227f47d 58# Generate a chain
c8f3da74 59cat server.pem ca.pem > server.chain
a227f47d 60
aac2124b
RG
61if ! nosetests --with-xunit $@; then
62 for log in configs/*.log; do
63 echo "=== ${log} ==="
64 cat "${log}"
65 done
66 false
67fi
a227f47d 68
8c15553e 69rm -f ca.key ca.pem ca.srl server.csr server.key server.pem server.chain server.ocsp