]> git.ipfire.org Git - thirdparty/pdns.git/blob - build-scripts/travis.sh
travis: install pdns package from direct download
[thirdparty/pdns.git] / build-scripts / travis.sh
1 #!/bin/bash
2
3 ## "upstream" travis functions
4 ANSI_RED="\033[31;1m"
5 ANSI_GREEN="\033[32;1m"
6 ANSI_RESET="\033[0m"
7 ANSI_CLEAR="\033[0K"
8
9 TRAVIS_TEST_RESULT=
10 TRAVIS_CMD=
11
12 function 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
56 travis_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
62 travis_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
70 function 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
84 travis_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
92 travis_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
103 travis_terminate() {
104 pkill -9 -P $$ &> /dev/null || true
105 exit $1
106 }
107
108 travis_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
147 travis_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
168 travis_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
189 travis_fold() {
190 local action=$1
191 local name=$2
192 echo -en "travis_fold:${action}:${name}\r${ANSI_CLEAR}"
193 }
194
195 decrypt() {
196 echo $1 | base64 -d | openssl rsautl -decrypt -inkey ~/.ssh/id_rsa.repo
197 }
198
199
200 run() {
201 travis_cmd "$1" --echo --assert
202 }
203
204 install_auth() {
205 # pkcs11 build requirements
206 run "sudo apt-get -qq --no-install-recommends install \
207 libp11-kit-dev"
208
209 # for validns
210 run "sudo add-apt-repository -y ppa:jelu/validns"
211 run 'curl "http://keyserver.ubuntu.com:11371/pks/lookup?op=get&search=0x7AA4AC1F04A52E842B88094F01B7B7D6564DECD0" | sudo apt-key add - '
212
213 # geoip-backend
214 run "sudo add-apt-repository -y ppa:maxmind/ppa"
215 run "gpg --keyserver keyserver.ubuntu.com --recv-keys DE742AFA"
216 run "gpg --export DE742AFA | sudo apt-key add -"
217 run "sudo apt-get update"
218 run "sudo apt-get -qq --no-install-recommends install \
219 libgeoip-dev \
220 libyaml-cpp-dev \
221 libmaxminddb-dev"
222
223 # lmdb-backend
224 run "sudo apt-get -qq --no-install-recommends install \
225 liblmdb-dev"
226
227 # remote-backend build requirements
228 run "sudo apt-get -qq --no-install-recommends install \
229 libzmq3-dev"
230
231 # godbc-backend
232 run "sudo apt-get -qq --no-install-recommends install \
233 libsqliteodbc"
234
235 # authoritative test requirements / setup
236 run "sudo apt-get -qq --no-install-recommends install \
237 bind9utils \
238 ldnsutils \
239 libnet-dns-perl \
240 moreutils \
241 unbound-host \
242 validns \
243 default-jre \
244 jq"
245
246 run "cd .."
247 run "wget https://github.com/dblacka/jdnssec-tools/releases/download/0.14/jdnssec-tools-0.14.tar.gz"
248 run "sudo tar xfz jdnssec-tools-0.14.tar.gz --strip-components=1 -C /"
249 run "cd ${TRAVIS_BUILD_DIR}"
250
251 # pkcs11 test requirements / setup
252 run "sudo apt-get -qq --no-install-recommends install \
253 p11-kit \
254 softhsm"
255 run "sudo mkdir -p /etc/pkcs11/modules/"
256 run "sudo cp -f regression-tests/softhsm.mod /etc/pkcs11/modules/softhsm.module"
257 run "sudo cp -f regression-tests/softhsm.conf /etc/softhsm/softhsm.conf"
258 run "sudo chmod 0755 /etc/softhsm/"
259 run "sudo chmod 0644 /etc/softhsm/softhsm.conf"
260 run "sudo chmod 0777 /var/lib/softhsm"
261 run "p11-kit -l" # ensure it's ok
262
263 # bind-backend tests requirements
264 run "sudo apt-get -qq --no-install-recommends install \
265 alien\
266 fakeroot"
267 run "cd .."
268 run "wget https://downloads.powerdns.com/tmp/dnsperf-2.0.0.0-1-rhel-6-x86_64.tar.gz"
269 run "tar xzvf dnsperf-2.0.0.0-1-rhel-6-x86_64.tar.gz"
270 run "fakeroot alien --to-deb dnsperf-2.0.0.0-1/dnsperf-2.0.0.0-1.el6.x86_64.rpm"
271 run "sudo dpkg -i dnsperf_2.0.0.0-2_amd64.deb"
272 run "cd ${TRAVIS_BUILD_DIR}"
273
274 # geoip-backend test requirements / setup
275 run "sudo apt-get -qq --no-install-recommends install \
276 geoip-database"
277
278 # gmysql-backend test requirements
279 # as of 2016/12/01, mysql-5.6 is now installed in the default travis image
280 # see https://github.com/travis-ci/travis-ci/issues/6961
281 #run "sudo apt-get -qq --no-install-recommends install \
282 # mysql-server"
283
284 # godbc-backend test setup
285 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'
286 run 'echo ${HOME}/.odbc.ini'
287 run 'cat ${HOME}/.odbc.ini'
288
289 # remote-backend tests requirements
290 run "sudo apt-get -qq --no-install-recommends install \
291 ruby-json \
292 rubygems-integration \
293 socat"
294 run "gem update --system"
295 run "gem install bundler --no-rdoc --no-ri"
296 run "cd modules/remotebackend"
297 run "ruby -S bundle install"
298 run "cd ../.."
299
300 # tinydns
301 run "sudo apt-get -qq --no-install-recommends install \
302 libcdb-dev"
303
304 # No backend
305 run "sudo apt-get -qq --no-install-recommends install \
306 authbind \
307 faketime"
308 run "sudo touch /etc/authbind/byport/53"
309 run "sudo chmod 755 /etc/authbind/byport/53"
310
311 # Install dnsmasq to make lookups more robust
312 run "sudo apt-get -qq --no-install-recommends install \
313 dnsmasq"
314 run 'echo listen-address=127.0.0.53 | sudo tee /etc/dnsmasq.d/local.conf'
315 run 'echo bind-interfaces | sudo tee -a /etc/dnsmasq.d/local.conf'
316
317 ## WARNING
318 ## after this dnsmasq restart, DNS lookups will fail for a few seconds.
319 run 'sudo service dnsmasq restart'
320 run "sudo resolvconf --disable-updates"
321 run 'echo nameserver 127.0.0.53 | sudo tee /etc/resolv.conf'
322 run "export RESOLVERIP=127.0.0.53"
323 }
324
325 install_ixfrdist() {
326 run "sudo apt-get -qq --no-install-recommends install \
327 libyaml-cpp-dev"
328 }
329
330 install_recursor() {
331 # recursor test requirements / setup
332 # lua-posix is required for the ghost tests
333 # (used by the prequery script in the auth)
334 run "sudo apt-get -qq --no-install-recommends install \
335 authbind \
336 daemontools \
337 jq \
338 libfaketime \
339 libsnmp-dev \
340 lua-posix \
341 lua-socket \
342 moreutils \
343 snmpd"
344 run "cd .."
345 run "wget http://s3-us-west-1.amazonaws.com/umbrella-static/top-1m.csv.zip"
346 run "unzip top-1m.csv.zip -d ${TRAVIS_BUILD_DIR}/regression-tests"
347 run 'wget https://downloads.powerdns.com/tmp/pdns-4.2.0-rc2.255.master.g2bee14438-ubuntu-trusty.tar.bz2'
348 run 'tar xf pdns-4.2.0-rc2.255.master.g2bee14438-ubuntu-trusty.tar.bz2'
349 run 'sudo dpkg -i pdns-4.2.0-rc2.255.master.g2bee14438-ubuntu-trusty/pdns-server_4.2.0~rc2+master.255.g2bee14438-1pdns.trusty_amd64.deb pdns-4.2.0-rc2.255.master.g2bee14438-ubuntu-trusty/pdns-tools_4.2.0~rc2+master.255.g2bee14438-1pdns.trusty_amd64.deb pdns-4.2.0-rc2.255.master.g2bee14438-ubuntu-trusty/pdns-backend-bind_4.2.0~rc2+master.255.g2bee14438-1pdns.trusty_amd64.deb ; sudo apt-get -y install -f'
350 run 'sudo apt-get -y install pdns-server pdns-tools'
351 run "sudo service pdns stop"
352 run 'for suffix in {1..40}; do sudo /sbin/ip addr add 10.0.3.$suffix/32 dev lo; done'
353 run "sudo touch /etc/authbind/byport/53"
354 run "sudo chmod 755 /etc/authbind/byport/53"
355 run "cd ${TRAVIS_BUILD_DIR}"
356 # install SNMP
357 run "sudo sed -i \"s/agentxperms 0700 0755 recursor/agentxperms 0700 0755 ${USER}/g\" regression-tests.recursor-dnssec/snmpd.conf"
358 run "sudo cp -f regression-tests.recursor-dnssec/snmpd.conf /etc/snmp/snmpd.conf"
359 run "sudo service snmpd restart"
360 ## fun story, the directory perms are only applied if it doesn't exist yet, and it is created by the init script, so..
361 run "sudo chmod 0755 /var/agentx"
362 }
363
364 install_dnsdist() {
365 # test requirements / setup
366 run "sudo add-apt-repository -y ppa:zeha/libfstrm-ppa"
367 run 'curl "http://keyserver.ubuntu.com:11371/pks/lookup?op=get&search=0x396160EF8126A2E2" | sudo apt-key add - '
368 run "sudo apt-get -qq update"
369 run "sudo apt-get -qq --no-install-recommends install \
370 snmpd \
371 libcdb-dev \
372 libfstrm-dev \
373 liblmdb-dev \
374 libsnmp-dev"
375 run "sudo sed -i \"s/agentxperms 0700 0755 dnsdist/agentxperms 0700 0755 ${USER}/g\" regression-tests.dnsdist/snmpd.conf"
376 run "sudo cp -f regression-tests.dnsdist/snmpd.conf /etc/snmp/snmpd.conf"
377 run "sudo service snmpd restart"
378 # fun story, the directory perms are only applied if it doesn't exist yet, and it is created by the init script, so..
379 run "sudo chmod 0755 /var/agentx"
380 }
381
382 check_for_dangling_symlinks() {
383 run '! find -L . -name missing-sources -prune -o ! -name pubsuffix.cc -type l | grep .'
384 }
385
386 build_auth() {
387 run "autoreconf -vi"
388 run "./configure \
389 ${sanitizerflags} \
390 --with-dynmodules='bind gmysql geoip gpgsql gsqlite3 lmdb pipe random remote tinydns godbc lua2' \
391 --with-modules='' \
392 --with-sqlite3 \
393 --with-libsodium \
394 --enable-experimental-pkcs11 \
395 --enable-remotebackend-zeromq \
396 --enable-tools \
397 --enable-unit-tests \
398 --enable-backend-unit-tests \
399 --enable-fuzz-targets \
400 --disable-dependency-tracking \
401 --disable-silent-rules \
402 --with-lmdb=/usr"
403 run "make -k dist"
404 run "make -k -j3"
405 run "make -k install DESTDIR=/tmp/pdns-install-dir"
406 run "find /tmp/pdns-install-dir -ls"
407 }
408
409 build_ixfrdist() {
410 run "autoreconf -vi"
411 run "./configure \
412 ${sanitizerflags} \
413 --with-dynmodules='bind' \
414 --with-modules='' \
415 --enable-ixfrdist \
416 --enable-unit-tests \
417 --disable-dependency-tracking \
418 --disable-silent-rules"
419 run "make -C ext -k -j3"
420 run "cd pdns"
421 run "make -k -j3 ixfrdist"
422 run "cd .."
423 }
424
425 build_recursor() {
426 export PDNS_RECURSOR_DIR=$HOME/pdns_recursor
427 run "cd pdns/recursordist"
428 check_for_dangling_symlinks
429 run "cd ../.."
430 # distribution build
431 run "./build-scripts/dist-recursor"
432 run "cd pdns/recursordist"
433 run "tar xf pdns-recursor-*.tar.bz2"
434 run "rm -f pdns-recursor-*.tar.bz2"
435 run "cd pdns-recursor-*"
436 run "./configure \
437 ${sanitizerflags} \
438 --prefix=$PDNS_RECURSOR_DIR \
439 --with-libsodium \
440 --enable-unit-tests \
441 --enable-nod \
442 --disable-dnstap \
443 --disable-silent-rules"
444 run "make -k -j3"
445 run "make install"
446 run "find $PDNS_RECURSOR_DIR -ls"
447 run "cd ../../.."
448 }
449
450 build_dnsdist(){
451 run "cd pdns/dnsdistdist"
452 check_for_dangling_symlinks
453 run "cd ../.."
454 run "./build-scripts/dist-dnsdist"
455 run "cd pdns/dnsdistdist"
456 run "tar xf dnsdist*.tar.bz2"
457 run "cd dnsdist-*"
458 run "./configure \
459 ${sanitizerflags} \
460 --enable-unit-tests \
461 --with-libsodium \
462 --enable-dnscrypt \
463 --enable-dns-over-tls \
464 --enable-dnstap \
465 --with-lmdb=/usr \
466 --prefix=$HOME/dnsdist \
467 --disable-silent-rules"
468 run "make -k -j3"
469 run "./testrunner"
470 run "make install"
471 run "cd ../../.."
472 run "find $HOME/dnsdist -ls"
473 run "rm -rf pdns/dnsdistdist/dnsdist-*/"
474
475 }
476
477 test_auth() {
478 run "make -j3 check || (cat pdns/test-suite.log; false)"
479 run "test -f pdns/test-suite.log && cat pdns/test-suite.log || true"
480 run "test -f modules/remotebackend/test-suite.log && cat modules/remotebackend/test-suite.log || true"
481
482 #DNSName - make -k -j3 -C pdns $(grep '(EXEEXT):' pdns/Makefile | cut -f1 -d\$ | grep -E -v 'dnsdist|calidns')
483 run 'make -k -j3 -C pdns $(grep "(EXEEXT):" pdns/Makefile | cut -f1 -d\$)'
484
485 run "cd pdns"
486 run "./pdnsutil test-algorithms"
487 run "cd .."
488
489 run "cd regression-tests"
490
491 #travis unbound is too old for this test (unbound 1.6.0 required)
492 run "touch tests/ent-asterisk/fail.nsec"
493
494 run "./timestamp ./start-test-stop 5300 bind-both"
495 run "./timestamp ./start-test-stop 5300 bind-dnssec-both"
496 run "./timestamp ./start-test-stop 5300 bind-dnssec-nsec3-both"
497 # run "./timestamp ./start-test-stop 5300 bind-dnssec-nsec3-optout-both"
498 run "./timestamp ./start-test-stop 5300 bind-dnssec-nsec3-narrow"
499 run "./timestamp ./start-test-stop 5300 bind-hybrid-nsec3"
500 #ecdsa - ./timestamp ./start-test-stop 5300 bind-dnssec-pkcs11
501
502 run "./timestamp ./start-test-stop 5300 geoip"
503 run "./timestamp ./start-test-stop 5300 geoip-nsec3-narrow"
504 run "export geoipdatabase=../modules/geoipbackend/regression-tests/GeoLiteCity.mmdb"
505 run "./timestamp ./start-test-stop 5300 geoip"
506
507 run "./timestamp ./start-test-stop 5300 gmysql-nodnssec-both"
508 run "./timestamp ./start-test-stop 5300 gmysql-both"
509 run "./timestamp ./start-test-stop 5300 gmysql-nsec3-both"
510 # run "./timestamp ./start-test-stop 5300 gmysql-nsec3-optout-both"
511 run "./timestamp ./start-test-stop 5300 gmysql-nsec3-narrow"
512
513 run "sudo perl -i -pe 's/\]/]\nThreading=1/g' /etc/odbcinst.ini"
514 run "cat /etc/odbcinst.ini"
515 run "export GODBC_SQLITE3_DSN=pdns-sqlite3-1"
516 # this test is unstable on the library versions in the Travis trusty image
517 # run "./timestamp ./start-test-stop 5300 godbc_sqlite3-nsec3"
518
519 run "./timestamp ./start-test-stop 5300 gpgsql-nodnssec-both"
520 run "./timestamp ./start-test-stop 5300 gpgsql-both"
521 run "./timestamp ./start-test-stop 5300 gpgsql-nsec3-both"
522 #run "./timestamp ./start-test-stop 5300 gpgsql-nsec3-optout-both"
523 #run "./timestamp ./start-test-stop 5300 gpgsql-nsec3-narrow"
524
525 run "./timestamp ./start-test-stop 5300 gsqlite3-nodnssec-both"
526 run "./timestamp ./start-test-stop 5300 gsqlite3-both"
527 run "./timestamp ./start-test-stop 5300 gsqlite3-nsec3-both"
528 # run "./timestamp ./start-test-stop 5300 gsqlite3-nsec3-optout-both"
529 run "./timestamp ./start-test-stop 5300 gsqlite3-nsec3-narrow"
530
531 run "./timestamp ./start-test-stop 5300 remotebackend-pipe"
532 run "./timestamp ./start-test-stop 5300 remotebackend-pipe-dnssec"
533 #run "./timestamp ./start-test-stop 5300 remotebackend-unix"
534 run "./timestamp ./start-test-stop 5300 remotebackend-unix-dnssec"
535 #run "./timestamp ./start-test-stop 5300 remotebackend-http"
536 run "./timestamp ./start-test-stop 5300 remotebackend-http-dnssec"
537 #run "./timestamp ./start-test-stop 5300 remotebackend-zeromq"
538 run "./timestamp ./start-test-stop 5300 remotebackend-zeromq-dnssec"
539
540 run "./timestamp ./start-test-stop 5300 tinydns"
541
542 run "./timestamp ./start-test-stop 5300 lmdb-nodnssec-both"
543 run "./timestamp ./start-test-stop 5300 lmdb-both"
544 run "./timestamp ./start-test-stop 5300 lmdb-nsec3-both"
545 # run "./timestamp ./start-test-stop 5300 lmdb-nsec3-optout-both"
546
547 run "rm tests/ent-asterisk/fail.nsec"
548
549 run "cd ../regression-tests.rootzone"
550 run "./timestamp ./start-test-stop 5300 bind-both"
551 run "./timestamp ./start-test-stop 5300 bind-dnssec-both"
552 run "./timestamp ./start-test-stop 5300 bind-dnssec-nsec3-both"
553 # run "./timestamp ./start-test-stop 5300 bind-dnssec-nsec3-optout-both"
554 run "./timestamp ./start-test-stop 5300 bind-dnssec-nsec3-narrow"
555 run "./timestamp ./start-test-stop 5300 bind-hybrid-nsec3"
556
557 run "./timestamp ./start-test-stop 5300 gmysql-nodnssec-both"
558 run "./timestamp ./start-test-stop 5300 gmysql-both"
559 run "./timestamp ./start-test-stop 5300 gmysql-nsec3-both"
560 # run "./timestamp ./start-test-stop 5300 gmysql-nsec3-optout-both"
561 run "./timestamp ./start-test-stop 5300 gmysql-nsec3-narrow"
562
563 run "./timestamp ./start-test-stop 5300 gpgsql-nodnssec-both"
564 run "./timestamp ./start-test-stop 5300 gpgsql-both"
565 run "./timestamp ./start-test-stop 5300 gpgsql-nsec3-both"
566 # run "./timestamp ./start-test-stop 5300 gpgsql-nsec3-optout-both"
567 run "./timestamp ./start-test-stop 5300 gpgsql-nsec3-narrow"
568
569 run "./timestamp ./start-test-stop 5300 gsqlite3-nodnssec-both"
570 run "./timestamp ./start-test-stop 5300 gsqlite3-both"
571 run "./timestamp ./start-test-stop 5300 gsqlite3-nsec3-both"
572 # run "./timestamp ./start-test-stop 5300 gsqlite3-nsec3-optout-both"
573 run "./timestamp ./start-test-stop 5300 gsqlite3-nsec3-narrow"
574
575 run "./timestamp ./start-test-stop 5300 lua2"
576 run "./timestamp ./start-test-stop 5300 lua2-dnssec"
577
578 run "./timestamp ./start-test-stop 5300 lmdb-both"
579 run "./timestamp ./start-test-stop 5300 lmdb-nodnssec-both"
580 run "./timestamp ./start-test-stop 5300 lmdb-nsec3-both"
581 # run "./timestamp ./start-test-stop 5300 lmdb-nsec3-optout-both"
582
583 run "cd .."
584
585 ### api ###
586 run "cd regression-tests.api"
587 run "./runtests authoritative"
588 run "cd .."
589
590 ### no backend tests ###
591 run "cd regression-tests.nobackend/"
592 run "./runtests"
593 run "test ! -s ./failed_tests"
594 run "cd .."
595
596 ### Lua rec tests ###
597 run "cd regression-tests.auth-py"
598 run "./runtests -v || (cat ./configs/auth/pdns.log; false)"
599 run "cd .."
600
601 run "rm -f regression-tests/zones/*-slave.*" #FIXME
602 }
603
604 test_ixfrdist(){
605 run "cd regression-tests.ixfrdist"
606 run "IXFRDISTBIN=${TRAVIS_BUILD_DIR}/pdns/ixfrdist ./runtests -v || (cat ixfrdist.log; false)"
607 run "cd .."
608 }
609
610 test_recursor() {
611 export PDNSRECURSOR="${PDNS_RECURSOR_DIR}/sbin/pdns_recursor"
612 export DNSBULKTEST="/usr/bin/dnsbulktest"
613 export RECCONTROL="${PDNS_RECURSOR_DIR}/bin/rec_control"
614 run "cd pdns/recursordist/pdns-recursor-*"
615 run "make -j 3 check || (cat test-suite.log; false)"
616 run "cd ${TRAVIS_BUILD_DIR}"
617 run "./build-scripts/test-recursor"
618 export RECURSOR="${PDNSRECURSOR}"
619 run "cd regression-tests"
620 run "THRESHOLD=50 TRACE=no ./timestamp ./recursor-test 5300 50000"
621 run "cd .."
622
623 run "cd regression-tests.api"
624 run "./runtests recursor"
625 run "cd .."
626 }
627
628 test_dnsdist(){
629 run "cd regression-tests.dnsdist"
630 export SKIP_DOH_TESTS=1
631 export SKIP_PROMETHEUS_TESTS=1
632 run "DNSDISTBIN=$HOME/dnsdist/bin/dnsdist ./runtests -v --ignore-files='(?:^\.|^_,|^setup\.py$|^test_TLSSessionResumption\.py$)'"
633 run "rm -f ./DNSCryptResolver.cert ./DNSCryptResolver.key"
634 run "cd .."
635 }
636
637 test_repo(){
638 run "git status"
639 run "git status | grep -q clean"
640 }
641
642 # global build requirements
643 run "sudo apt-get -qq --no-install-recommends install \
644 libboost-all-dev \
645 libluajit-5.1-dev \
646 libedit-dev \
647 libprotobuf-dev \
648 protobuf-compiler"
649
650 run "cd .."
651 run "wget http://ppa.launchpad.net/kalon33/gamesgiroll/ubuntu/pool/main/libs/libsodium/libsodium-dev_1.0.3-1~ppa14.04+1_amd64.deb"
652 run "wget http://ppa.launchpad.net/kalon33/gamesgiroll/ubuntu/pool/main/libs/libsodium/libsodium13_1.0.3-1~ppa14.04+1_amd64.deb"
653 run "sudo dpkg -i libsodium-dev_1.0.3-1~ppa14.04+1_amd64.deb libsodium13_1.0.3-1~ppa14.04+1_amd64.deb"
654 run "cd ${TRAVIS_BUILD_DIR}"
655
656 compilerflags="-O1 -Werror=vla"
657 sanitizerflags=""
658 if [ "$CC" = "clang" ]
659 then
660 compilerflags="$compilerflags -Werror=string-plus-int"
661 if [ "${PDNS_BUILD_PRODUCT}" = "recursor" ]; then
662 sanitizerflags="${sanitizerflags} --enable-asan"
663 elif [ "${PDNS_BUILD_PRODUCT}" = "dnsdist" ]; then
664 sanitizerflags="${sanitizerflags} --enable-asan --enable-ubsan"
665 elif [ "${PDNS_BUILD_PRODUCT}" = "ixfrdist" ]; then
666 sanitizerflags="${sanitizerflags} --enable-asan --enable-ubsan"
667 fi
668 fi
669 export CFLAGS=$compilerflags
670 export CXXFLAGS=$compilerflags
671 export sanitizerflags
672 # We need a suppression for UndefinedBehaviorSanitizer with ixfrdist,
673 # because of a vptr bug fixed in Boost 1.57.0:
674 # https://github.com/boostorg/any/commit/c92ab03ab35775b6aab30f6cdc3d95b7dd8fc5c6
675 export UBSAN_OPTIONS="print_stacktrace=1:halt_on_error=1:suppressions=${TRAVIS_BUILD_DIR}/build-scripts/UBSan.supp"
676
677 install_$PDNS_BUILD_PRODUCT
678
679 build_$PDNS_BUILD_PRODUCT
680
681 test_$PDNS_BUILD_PRODUCT
682
683 if [ $PDNS_BUILD_PRODUCT == "auth" ]; then
684 test_repo
685 fi