]> git.ipfire.org Git - thirdparty/pdns.git/blame - build-scripts/travis.sh
dnsdist: record query time in DNSQuestion
[thirdparty/pdns.git] / build-scripts / travis.sh
CommitLineData
bf6096f5
PL
1#!/bin/bash
2
3## "upstream" travis functions
4ANSI_RED="\033[31;1m"
5ANSI_GREEN="\033[32;1m"
6ANSI_RESET="\033[0m"
7ANSI_CLEAR="\033[0K"
8
9TRAVIS_TEST_RESULT=
10TRAVIS_CMD=
11
12function travis_cmd() {
13 local assert output display retry timing cmd result
14
15 cmd=$1
16 TRAVIS_CMD=$cmd
17 shift
18
19 while true; do
20 case "$1" in
21 --assert) assert=true; shift ;;
22 --echo) output=true; shift ;;
23 --display) display=$2; shift 2;;
24 --retry) retry=true; shift ;;
25 --timing) timing=true; shift ;;
26 *) break ;;
27 esac
28 done
29
30 if [[ -n "$timing" ]]; then
31 travis_time_start
32 fi
33
34 if [[ -n "$output" ]]; then
35 echo "\$ ${display:-$cmd}"
36 fi
37
38 if [[ -n "$retry" ]]; then
39 travis_retry eval "$cmd"
40 else
41 eval "$cmd"
42 fi
43 result=$?
44
45 if [[ -n "$timing" ]]; then
46 travis_time_finish
47 fi
48
49 if [[ -n "$assert" ]]; then
50 travis_assert $result
51 fi
52
53 return $result
54}
55
56travis_time_start() {
57 travis_timer_id=$(printf %08x $(( RANDOM * RANDOM )))
58 travis_start_time=$(travis_nanoseconds)
59 echo -en "travis_time:start:$travis_timer_id\r${ANSI_CLEAR}"
60}
61
62travis_time_finish() {
63 local result=$?
64 travis_end_time=$(travis_nanoseconds)
65 local duration=$(($travis_end_time-$travis_start_time))
66 echo -en "\ntravis_time:end:$travis_timer_id:start=$travis_start_time,finish=$travis_end_time,duration=$duration\r${ANSI_CLEAR}"
67 return $result
68}
69
70function travis_nanoseconds() {
71 local cmd="date"
72 local format="+%s%N"
73 local os=$(uname)
74
75 if hash gdate > /dev/null 2>&1; then
76 cmd="gdate" # use gdate if available
77 elif [[ "$os" = Darwin ]]; then
78 format="+%s000000000" # fallback to second precision on darwin (does not support %N)
79 fi
80
81 $cmd -u $format
82}
83
84travis_assert() {
85 local result=${1:-$?}
86 if [ $result -ne 0 ]; then
87 echo -e "\n${ANSI_RED}The command \"$TRAVIS_CMD\" failed and exited with $result during $TRAVIS_STAGE.${ANSI_RESET}\n\nYour build has been stopped."
88 travis_terminate 2
89 fi
90}
91
92travis_result() {
93 local result=$1
94 export TRAVIS_TEST_RESULT=$(( ${TRAVIS_TEST_RESULT:-0} | $(($result != 0)) ))
95
96 if [ $result -eq 0 ]; then
97 echo -e "\n${ANSI_GREEN}The command \"$TRAVIS_CMD\" exited with $result.${ANSI_RESET}"
98 else
99 echo -e "\n${ANSI_RED}The command \"$TRAVIS_CMD\" exited with $result.${ANSI_RESET}"
100 fi
101}
102
103travis_terminate() {
104 pkill -9 -P $$ &> /dev/null || true
105 exit $1
106}
107
108travis_wait() {
109 local timeout=$1
110
111 if [[ $timeout =~ ^[0-9]+$ ]]; then
112 # looks like an integer, so we assume it's a timeout
113 shift
114 else
115 # default value
116 timeout=20
117 fi
118
119 local cmd="$@"
120 local log_file=travis_wait_$$.log
121
122 $cmd &>$log_file &
123 local cmd_pid=$!
124
125 travis_jigger $! $timeout $cmd &
126 local jigger_pid=$!
127 local result
128
129 {
130 wait $cmd_pid 2>/dev/null
131 result=$?
132 ps -p$jigger_pid &>/dev/null && kill $jigger_pid
133 }
134
135 if [ $result -eq 0 ]; then
136 echo -e "\n${ANSI_GREEN}The command $cmd exited with $result.${ANSI_RESET}"
137 else
138 echo -e "\n${ANSI_RED}The command $cmd exited with $result.${ANSI_RESET}"
139 fi
140
141 echo -e "\n${ANSI_GREEN}Log:${ANSI_RESET}\n"
142 cat $log_file
143
144 return $result
145}
146
147travis_jigger() {
148 # helper method for travis_wait()
149 local cmd_pid=$1
150 shift
151 local timeout=$1 # in minutes
152 shift
153 local count=0
154
155 # clear the line
156 echo -e "\n"
157
158 while [ $count -lt $timeout ]; do
159 count=$(($count + 1))
160 echo -ne "Still running ($count of $timeout): $@\r"
161 sleep 60
162 done
163
164 echo -e "\n${ANSI_RED}Timeout (${timeout} minutes) reached. Terminating \"$@\"${ANSI_RESET}\n"
165 kill -9 $cmd_pid
166}
167
168travis_retry() {
169 local result=0
170 local count=1
171 while [ $count -le 3 ]; do
172 [ $result -ne 0 ] && {
173 echo -e "\n${ANSI_RED}The command \"$@\" failed. Retrying, $count of 3.${ANSI_RESET}\n" >&2
174 }
175 "$@"
176 result=$?
177 [ $result -eq 0 ] && break
178 count=$(($count + 1))
179 sleep 1
180 done
181
182 [ $count -gt 3 ] && {
183 echo -e "\n${ANSI_RED}The command \"$@\" failed 3 times.${ANSI_RESET}\n" >&2
184 }
185
186 return $result
187}
188
189travis_fold() {
190 local action=$1
191 local name=$2
192 echo -en "travis_fold:${action}:${name}\r${ANSI_CLEAR}"
193}
194
195decrypt() {
196 echo $1 | base64 -d | openssl rsautl -decrypt -inkey ~/.ssh/id_rsa.repo
197}
198
199
200run() {
201 travis_cmd "$1" --echo --assert
202}
203
204install_auth() {
205 # pkcs11 build requirements
206 run "sudo apt-get -qq --no-install-recommends install \
207 libp11-kit-dev"
208
209 # geoip-backend
210 run "sudo apt-get -qq --no-install-recommends install \
211 libgeoip-dev \
212 libyaml-cpp-dev"
213
214 # ldap-backend
215 run "sudo apt-get -qq --no-install-recommends install \
216 libldap-dev"
217
218 # opendbx-backend
219 run "sudo apt-get -qq --no-install-recommends install \
220 libopendbx1-dev \
221 libopendbx1-sqlite3"
222
223 # remote-backend build requirements
224 run "sudo apt-get -qq --no-install-recommends install \
225 libzmq3-dev"
226
3a435d2e
PD
227 # godbc-backend
228 run "sudo apt-get -qq --no-install-recommends install \
229 libsqliteodbc"
230
bf6096f5
PL
231 # authoritative test requirements / setup
232 run "sudo apt-get -qq --no-install-recommends install \
233 bind9utils \
234 ldnsutils \
235 libnet-dns-perl \
236 moreutils \
237 unbound-host \
238 validns \
239 default-jre \
240 jq"
241
242 run "cd .."
14fa3ea1
PD
243 run "wget https://www.monshouwer.eu/download/3rd_party/jdnssec-tools-0.13.ecdsafix.tar.gz"
244 run "sudo tar xfz jdnssec-tools-0.13.ecdsafix.tar.gz --strip-components=1 -C /"
1e0253ca 245 run "cd ${TRAVIS_BUILD_DIR}"
bf6096f5
PL
246
247 # pkcs11 test requirements / setup
248 run "sudo apt-get -qq --no-install-recommends install \
249 p11-kit \
250 softhsm"
251 run "sudo mkdir -p /etc/pkcs11/modules/"
252 run "sudo cp -f regression-tests/softhsm.mod /etc/pkcs11/modules/softhsm.module"
253 run "sudo cp -f regression-tests/softhsm.conf /etc/softhsm/softhsm.conf"
254 run "sudo chmod 0755 /etc/softhsm/"
255 run "sudo chmod 0644 /etc/softhsm/softhsm.conf"
256 run "sudo chmod 0777 /var/lib/softhsm"
257 run "p11-kit -l" # ensure it's ok
258
259 # bind-backend tests requirements
260 run "sudo apt-get -qq --no-install-recommends install \
14fa3ea1
PD
261 alien\
262 fakeroot"
bf6096f5
PL
263 run "cd .."
264 run "wget ftp://ftp.nominum.com/pub/nominum/dnsperf/2.0.0.0/dnsperf-2.0.0.0-1-rhel-6-x86_64.tar.gz"
265 run "tar xzvf dnsperf-2.0.0.0-1-rhel-6-x86_64.tar.gz"
266 run "fakeroot alien --to-deb dnsperf-2.0.0.0-1/dnsperf-2.0.0.0-1.el6.x86_64.rpm"
267 run "sudo dpkg -i dnsperf_2.0.0.0-2_amd64.deb"
1e0253ca 268 run "cd ${TRAVIS_BUILD_DIR}"
bf6096f5
PL
269
270 # geoip-backend test requirements / setup
271 run "sudo apt-get -qq --no-install-recommends install \
272 geoip-database"
273
274 # gmysql-backend test requirements
d004b14c
RG
275 # as of 2016/12/01, mysql-5.6 is now installed in the default travis image
276 # see https://github.com/travis-ci/travis-ci/issues/6961
277 #run "sudo apt-get -qq --no-install-recommends install \
278 # mysql-server"
bf6096f5
PL
279
280 # godbc-backend test setup
3a435d2e
PD
281 run 'echo -e "[pdns-sqlite3-1]\nDriver = SQLite3\nDatabase = ${PWD}/regression-tests/pdns.sqlite3\n\n[pdns-sqlite3-2]\nDriver = SQLite3\nDatabase = ${PWD}/regression-tests/pdns.sqlite32\n" > ${HOME}/.odbc.ini'
282 run 'echo ${HOME}/.odbc.ini'
283 run 'cat ${HOME}/.odbc.ini'
bf6096f5
PL
284
285 # ldap-backend test setup
286 run "sudo apt-get -qq --no-install-recommends install \
287 slapd \
288 ldap-utils"
289 run "mkdir /tmp/ldap-dns"
290 run "pushd /tmp/ldap-dns"
291 run 'for schema in /etc/ldap/schema/{core,cosine}.schema ${TRAVIS_BUILD_DIR}/modules/ldapbackend/{dnsdomain2,pdns-domaininfo}.schema ; do echo include $schema ; done > ldap.conf'
292 run "mkdir slapd.d"
293 run "slaptest -f ldap.conf -F slapd.d"
294 run "sudo cp slapd.d/cn=config/cn=schema/cn={*dns*.ldif /etc/ldap/slapd.d/cn=config/cn=schema/"
295 run "sudo chown -R openldap:openldap /etc/ldap/slapd.d/"
296 run "sudo service slapd restart"
297 run "popd"
298 run "sudo -u openldap mkdir -p /var/lib/ldap/powerdns"
299 run "sudo ldapadd -Y EXTERNAL -H ldapi:/// -f ./modules/ldapbackend/testfiles/add.ldif"
300
301 # remote-backend tests requirements
302 run "sudo apt-get -qq --no-install-recommends install \
303 ruby-json \
304 rubygems-integration \
305 socat"
306 run "gem install bundler --no-rdoc --no-ri"
307 run "cd modules/remotebackend"
308 run "ruby -S bundle install"
309 run "cd ../.."
310
311 # tinydns
312 run "sudo apt-get -qq --no-install-recommends install \
313 libcdb-dev"
314
315 # No backend
316 run "sudo apt-get -qq --no-install-recommends install \
317 authbind \
318 faketime"
319 run "sudo touch /etc/authbind/byport/53"
320 run "sudo chmod 755 /etc/authbind/byport/53"
321}
322
bf6096f5
PL
323install_recursor() {
324 # recursor test requirements / setup
325 run "sudo apt-get -qq --no-install-recommends install \
326 authbind \
327 daemontools \
7c114c00 328 jq \
cb54e9b5 329 libfaketime \
7c114c00 330 libsnmp-dev \
bf6096f5 331 moreutils \
7c114c00 332 snmpd"
bf6096f5 333 run "cd .."
8a27076c 334 run "wget http://s3-us-west-1.amazonaws.com/umbrella-static/top-1m.csv.zip"
1e0253ca 335 run "unzip top-1m.csv.zip -d ${TRAVIS_BUILD_DIR}/regression-tests"
8a27076c 336 run 'echo -e "deb [arch=amd64] http://repo.powerdns.com/ubuntu trusty-auth-master main" | sudo tee /etc/apt/sources.list.d/pdns.list'
337 run 'echo -e "Package: pdns-*\nPin: origin repo.powerdns.com\nPin-Priority: 9001" | sudo tee /etc/apt/preferences.d/pdns'
338 run 'curl https://repo.powerdns.com/CBC8B383-pub.asc | sudo apt-key add - '
dad54543
PL
339 run 'sudo apt-get update'
340 run 'sudo apt-get -y install pdns-server pdns-tools'
e07dae82 341 run "sudo service pdns stop"
bf6096f5
PL
342 run 'for suffix in {1..40}; do sudo /sbin/ip addr add 10.0.3.$suffix/32 dev lo; done'
343 run "sudo touch /etc/authbind/byport/53"
344 run "sudo chmod 755 /etc/authbind/byport/53"
1e0253ca 345 run "cd ${TRAVIS_BUILD_DIR}"
bf6096f5
PL
346}
347
348install_dnsdist() {
35d883a8 349 # test requirements / setup
9f4eb5cc
RG
350 run "sudo apt-get -qq --no-install-recommends install \
351 snmpd \
352 libsnmp-dev"
353 run "sudo sed -i \"s/agentxperms 0700 0755 dnsdist/agentxperms 0700 0755 ${USER}/g\" regression-tests.dnsdist/snmpd.conf"
354 run "sudo cp -f regression-tests.dnsdist/snmpd.conf /etc/snmp/snmpd.conf"
355 run "sudo service snmpd restart"
356 # fun story, the directory perms are only applied if it doesn't exist yet, and it is created by the init script, so..
357 run "sudo chmod 0755 /var/agentx"
bf6096f5
PL
358}
359
360build_auth() {
361 run "./bootstrap"
e11963ce 362 # Build without --enable-botan, no botan 2.x in Travis CI
bf6096f5 363 run "CFLAGS='-O1' CXXFLAGS='-O1' ./configure \
3a435d2e 364 --with-dynmodules='bind gmysql geoip gpgsql gsqlite3 ldap lua mydns opendbx pipe random remote tinydns godbc' \
bf6096f5
PL
365 --with-modules='' \
366 --with-sqlite3 \
367 --enable-libsodium \
368 --enable-experimental-pkcs11 \
369 --enable-remotebackend-zeromq \
370 --enable-tools \
371 --enable-unit-tests \
372 --enable-backend-unit-tests \
373 --disable-dependency-tracking \
374 --disable-silent-rules"
375 run "make -k dist"
376 run "make -k -j3"
377 run "make -k install DESTDIR=/tmp/pdns-install-dir"
378 run "find /tmp/pdns-install-dir -ls"
379}
380
381build_recursor() {
382 export PDNS_RECURSOR_DIR=$HOME/pdns_recursor
383 # distribution build
384 run "./build-scripts/dist-recursor"
385 run "cd pdns/recursordist"
386 run "tar xf pdns-recursor-*.tar.bz2"
387 run "rm -f pdns-recursor-*.tar.bz2"
388 run "cd pdns-recursor-*"
e11963ce 389 # Build without --enable-botan, no botan 2.x in Travis CI
dcedbccf 390 run "CFLAGS='-O1' CXXFLAGS='-O1' CXX=${COMPILER} ./configure \
bf6096f5 391 --prefix=$PDNS_RECURSOR_DIR \
18a93d38 392 --enable-libsodium \
35d883a8 393 --enable-unit-tests \
bf6096f5
PL
394 --disable-silent-rules"
395 run "make -k -j3"
396 run "make install"
397 run "find $PDNS_RECURSOR_DIR -ls"
398 run "cd ../../.."
399}
400
401build_dnsdist(){
402 run "./build-scripts/dist-dnsdist"
403 run "cd pdns/dnsdistdist"
404 run "tar xf dnsdist*.tar.bz2"
405 run "cd dnsdist-*"
406 run "CFLAGS='-O1' CXXFLAGS='-O1' ./configure \
407 --enable-unit-tests \
408 --enable-libsodium \
409 --enable-dnscrypt \
a227f47d 410 --enable-dns-over-tls \
bf6096f5
PL
411 --prefix=$HOME/dnsdist \
412 --disable-silent-rules"
413 run "make -k -j3"
414 run "./testrunner"
415 run "make install"
416 run "cd ../../.."
417 run "find $HOME/dnsdist -ls"
418 run "rm -rf pdns/dnsdistdist/dnsdist-*/"
419
420}
421
bf6096f5 422test_auth() {
488c8611 423 run "make -j3 check || (cat pdns/test-suite.log; false)"
bf6096f5
PL
424 run "test -f pdns/test-suite.log && cat pdns/test-suite.log || true"
425 run "test -f modules/remotebackend/test-suite.log && cat modules/remotebackend/test-suite.log || true"
426
427 #DNSName - make -k -j3 -C pdns $(grep '(EXEEXT):' pdns/Makefile | cut -f1 -d\$ | grep -E -v 'dnsdist|calidns')
8695de46 428 run 'make -k -j3 -C pdns $(grep "(EXEEXT):" pdns/Makefile | cut -f1 -d\$)'
bf6096f5
PL
429
430 run "cd pdns"
431 run "./pdnsutil test-algorithms"
432 run "cd .."
433
434 run "cd regression-tests"
435
b6072c01
KM
436 #travis unbound is too old for this test (unbound 1.6.0 required)
437 run "touch tests/ent-asterisk/fail.nsec"
438
bf6096f5
PL
439 run "./timestamp ./start-test-stop 5300 ldap-tree"
440 run "./timestamp ./start-test-stop 5300 ldap-simple"
441 run "./timestamp ./start-test-stop 5300 ldap-strict"
442
443 run "./timestamp ./start-test-stop 5300 bind-both"
444 run "./timestamp ./start-test-stop 5300 bind-dnssec-both"
445 run "./timestamp ./start-test-stop 5300 bind-dnssec-nsec3-both"
446 run "./timestamp ./start-test-stop 5300 bind-dnssec-nsec3-optout-both"
447 run "./timestamp ./start-test-stop 5300 bind-dnssec-nsec3-narrow"
448 run "./timestamp ./start-test-stop 5300 bind-hybrid-nsec3"
449 #ecdsa - ./timestamp ./start-test-stop 5300 bind-dnssec-pkcs11
450
451 run "export geoipregion=oc geoipregionip=1.2.3.4"
452 run "./timestamp ./start-test-stop 5300 geoip"
453 run "./timestamp ./start-test-stop 5300 geoip-nsec3-narrow"
454
455 run "./timestamp ./start-test-stop 5300 gmysql-nodnssec-both"
456 run "./timestamp ./start-test-stop 5300 gmysql-both"
457 run "./timestamp ./start-test-stop 5300 gmysql-nsec3-both"
458 run "./timestamp ./start-test-stop 5300 gmysql-nsec3-optout-both"
459 run "./timestamp ./start-test-stop 5300 gmysql-nsec3-narrow"
460
461 run "export GODBC_SQLITE3_DSN=pdns-sqlite3-1"
3a435d2e 462 run "./timestamp ./start-test-stop 5300 godbc_sqlite3-nsec3"
bf6096f5
PL
463
464 run "./timestamp ./start-test-stop 5300 gpgsql-nodnssec-both"
465 run "./timestamp ./start-test-stop 5300 gpgsql-both"
466 run "./timestamp ./start-test-stop 5300 gpgsql-nsec3-both"
467 run "./timestamp ./start-test-stop 5300 gpgsql-nsec3-optout-both"
468 run "./timestamp ./start-test-stop 5300 gpgsql-nsec3-narrow"
469
470 run "./timestamp ./start-test-stop 5300 gsqlite3-nodnssec-both"
471 run "./timestamp ./start-test-stop 5300 gsqlite3-both"
472 run "./timestamp ./start-test-stop 5300 gsqlite3-nsec3-both"
473 run "./timestamp ./start-test-stop 5300 gsqlite3-nsec3-optout-both"
474 run "./timestamp ./start-test-stop 5300 gsqlite3-nsec3-narrow"
475
476 run "./timestamp ./start-test-stop 5300 mydns"
477
478 run "./timestamp ./start-test-stop 5300 opendbx-sqlite3"
479
480 run "./timestamp ./start-test-stop 5300 remotebackend-pipe"
481 run "./timestamp ./start-test-stop 5300 remotebackend-pipe-dnssec"
482 run "./timestamp ./start-test-stop 5300 remotebackend-unix"
483 run "./timestamp ./start-test-stop 5300 remotebackend-unix-dnssec"
484 run "./timestamp ./start-test-stop 5300 remotebackend-http"
485 run "./timestamp ./start-test-stop 5300 remotebackend-http-dnssec"
486 run "./timestamp ./start-test-stop 5300 remotebackend-zeromq"
487 run "./timestamp ./start-test-stop 5300 remotebackend-zeromq-dnssec"
488
489 run "./timestamp ./start-test-stop 5300 tinydns"
b6072c01
KM
490
491 run "rm tests/ent-asterisk/fail.nsec"
492
8cce0396
KM
493 run "cd ../modules/luabackend/test2"
494 run "../../../regression-tests/timestamp ./runtest"
495
496 run "cd ../../.."
bf6096f5
PL
497
498 run "cd regression-tests.rootzone"
499 run "./timestamp ./start-test-stop 5300 bind-both"
500 run "./timestamp ./start-test-stop 5300 bind-dnssec-both"
501 run "./timestamp ./start-test-stop 5300 bind-dnssec-nsec3-both"
502 run "./timestamp ./start-test-stop 5300 bind-dnssec-nsec3-optout-both"
503 run "./timestamp ./start-test-stop 5300 bind-dnssec-nsec3-narrow"
504 run "./timestamp ./start-test-stop 5300 bind-hybrid-nsec3"
505
506 run "./timestamp ./start-test-stop 5300 gmysql-nodnssec-both"
507 run "./timestamp ./start-test-stop 5300 gmysql-both"
508 run "./timestamp ./start-test-stop 5300 gmysql-nsec3-both"
509 run "./timestamp ./start-test-stop 5300 gmysql-nsec3-optout-both"
510 run "./timestamp ./start-test-stop 5300 gmysql-nsec3-narrow"
511
512 run "./timestamp ./start-test-stop 5300 gpgsql-nodnssec-both"
513 run "./timestamp ./start-test-stop 5300 gpgsql-both"
514 run "./timestamp ./start-test-stop 5300 gpgsql-nsec3-both"
515 run "./timestamp ./start-test-stop 5300 gpgsql-nsec3-optout-both"
516 run "./timestamp ./start-test-stop 5300 gpgsql-nsec3-narrow"
517
518 run "./timestamp ./start-test-stop 5300 gsqlite3-nodnssec-both"
519 run "./timestamp ./start-test-stop 5300 gsqlite3-both"
520 run "./timestamp ./start-test-stop 5300 gsqlite3-nsec3-both"
521 run "./timestamp ./start-test-stop 5300 gsqlite3-nsec3-optout-both"
522 run "./timestamp ./start-test-stop 5300 gsqlite3-nsec3-narrow"
523
524 run "cd .."
525
526 ### api ###
527 run "cd regression-tests.api"
528 run "./runtests authoritative"
529 run "cd .."
530
531 ### no backend tests ###
532 run "cd regression-tests.nobackend/"
533 run "./runtests"
534 run "test ! -s ./failed_tests"
535 run "cd .."
536
537 run "rm -f regression-tests/zones/*-slave.*" #FIXME
538}
539
540test_recursor() {
541 export PDNSRECURSOR="${PDNS_RECURSOR_DIR}/sbin/pdns_recursor"
bf6096f5
PL
542 export DNSBULKTEST="/usr/bin/dnsbulktest"
543 export RECCONTROL="${PDNS_RECURSOR_DIR}/bin/rec_control"
35d883a8 544 run "cd pdns/recursordist/pdns-recursor-*"
6aac061c 545 run "make -j 3 check || (cat test-suite.log; false)"
35d883a8 546 run "cd ${TRAVIS_BUILD_DIR}"
7568b07d
PL
547 run "./build-scripts/test-recursor"
548 export RECURSOR="${PDNSRECURSOR}"
bf6096f5 549 run "cd regression-tests"
9fb6940f 550 run "THRESHOLD=95 TRACE=no ./timestamp ./recursor-test 5300 50000"
bf6096f5 551 run "cd .."
7568b07d 552
bf6096f5
PL
553 run "cd regression-tests.api"
554 run "./runtests recursor"
555 run "cd .."
556}
557
bf6096f5
PL
558test_dnsdist(){
559 run "cd regression-tests.dnsdist"
560 run "DNSDISTBIN=$HOME/dnsdist/bin/dnsdist ./runtests -v"
561 run "rm -f ./DNSCryptResolver.cert ./DNSCryptResolver.key"
562 run "cd .."
563}
564
565test_repo(){
566 run "git status"
567 run "git status | grep -q clean"
568}
569
570# global build requirements
e11963ce 571# Add botan 2.x when available in Travis CI
bf6096f5
PL
572run "sudo apt-get -qq --no-install-recommends install \
573 libboost-all-dev \
574 liblua5.1-dev \
575 libedit-dev \
0a4a38ab
PL
576 libprotobuf-dev \
577 pandoc\
578 protobuf-compiler"
bf6096f5
PL
579
580run "cd .."
581run "wget http://ppa.launchpad.net/kalon33/gamesgiroll/ubuntu/pool/main/libs/libsodium/libsodium-dev_1.0.3-1~ppa14.04+1_amd64.deb"
582run "wget http://ppa.launchpad.net/kalon33/gamesgiroll/ubuntu/pool/main/libs/libsodium/libsodium13_1.0.3-1~ppa14.04+1_amd64.deb"
583run "sudo dpkg -i libsodium-dev_1.0.3-1~ppa14.04+1_amd64.deb libsodium13_1.0.3-1~ppa14.04+1_amd64.deb"
1e0253ca 584run "cd ${TRAVIS_BUILD_DIR}"
bf6096f5
PL
585
586install_$PDNS_BUILD_PRODUCT
587
588build_$PDNS_BUILD_PRODUCT
589
590test_$PDNS_BUILD_PRODUCT
591
d2a4a399 592if [ $PDNS_BUILD_PRODUCT == "auth" ]; then
bf6096f5
PL
593 test_repo
594fi