5 description: "Do a shallow checkout of the repository"
8 name: Install git and openssh
9 command: apt-get update && apt-get -qq -y install openssh-client git
11 name: Store the keyid for the git repo
12 command: mkdir -p $HOME/.ssh && ssh-keyscan $(echo ${CIRCLE_REPOSITORY_URL} | sed 's,.*@\([^:]*\):.*,\1,') > $HOME/.ssh/known_hosts
16 if [ -n "$CIRCLE_PR_NUMBER" ]
18 echo === Checking out PR "$CIRCLE_PR_NUMBER" from "$CIRCLE_REPOSITORY_URL"
19 git clone --depth 1 $CIRCLE_REPOSITORY_URL ~/project
21 git fetch --depth 1 origin +refs/pull/${CIRCLE_PR_NUMBER}/merge
22 git checkout -qf FETCH_HEAD
24 echo === Checking out branch "${CIRCLE_BRANCH}" from "$CIRCLE_REPOSITORY_URL"
25 git clone --depth 1 --branch $CIRCLE_BRANCH $CIRCLE_REPOSITORY_URL ~/project
30 description: Prepare the environment for auth regression tests
33 name: ensure ca-certificates is installed
34 command: apt-get update && apt-get -qq -y install ca-certificates
39 name: Install test dependencies
41 apt-get -y -qq install \
44 default-jre-headless \
50 name: Install jdnssectools
52 if [ ! -e /usr/bin/jdnssec-verifyzone ]; then
53 apt-get install -qq -y wget
54 wget https://github.com/dblacka/jdnssec-tools/releases/download/0.14/jdnssec-tools-0.14.tar.gz
55 tar xfz jdnssec-tools-0.14.tar.gz --strip-components=1 -C /
56 rm jdnssec-tools-0.14.tar.gz
60 name: Allow missing tools in verify-dnssec-zone
61 command: touch regression-tests/tests/verify-dnssec-zone/allow-missing
64 description: Run one auth regression context
80 default: "/opt/pdns-auth/"
83 workdir: ~/project/regression-tests
84 name: Run << parameters.context >> tests
86 [ -e ./vars ] && . ./vars
88 for t in << parameters.skip >>
92 PDNS=<< parameters.prefix >>sbin/pdns_server \
93 PDNS2=<< parameters.prefix >>sbin/pdns_server \
94 SDIG=<< parameters.prefix >>bin/sdig \
95 NOTIFY=<< parameters.prefix >>bin/pdns_notify \
96 NSEC3DIG=<< parameters.prefix >>bin/nsec3dig \
97 SAXFR=<< parameters.prefix >>bin/saxfr \
98 ZONE2SQL=<< parameters.prefix >>bin/zone2sql \
99 ZONE2LDAP=<< parameters.prefix >>bin/zone2ldap \
100 PDNSUTIL=<< parameters.prefix >>bin/pdnsutil \
101 PDNSCONTROL=<< parameters.prefix >>bin/pdns_control \
102 ./start-test-stop 5300 << parameters.context >>
104 condition: << parameters.doroot >>
107 workdir: ~/project/regression-tests.rootzone
108 name: Run << parameters.context >> tests for the root zone
110 [ -e ../regression-tests/vars ] && . ../regression-tests/vars
112 for t in << parameters.rootskip >>
116 PDNS=<< parameters.prefix >>sbin/pdns_server \
117 PDNS2=<< parameters.prefix >>sbin/pdns_server \
118 SDIG=<< parameters.prefix >>bin/sdig \
119 NOTIFY=<< parameters.prefix >>bin/pdns_notify \
120 NSEC3DIG=<< parameters.prefix >>bin/nsec3dig \
121 SAXFR=<< parameters.prefix >>bin/saxfr \
122 ZONE2SQL=<< parameters.prefix >>bin/zone2sql \
123 ZONE2LDAP=<< parameters.prefix >>bin/zone2ldap \
124 PDNSUTIL=<< parameters.prefix >>bin/pdnsutil \
125 PDNSCONTROL=<< parameters.prefix >>bin/pdns_control \
126 ./start-test-stop 5300 << parameters.context >>
128 install-recursor-deps:
129 description: "Install all libraries needed for the recursor"
131 - run: apt-get update
134 apt-get install -qq -y \
144 description: Install all libraries needed to run the auth
147 apt-get install -qq -y --no-install-recommends \
157 default-libmysqlclient-dev \
160 install-auth-dev-deps:
161 description: Install all packages needed to build the auth
163 - run: apt-get update
166 apt-get install -qq -y --no-install-recommends \
170 default-libmysqlclient-dev \
193 description: "Add the debian repo for the auth"
206 name: "Install dependencies"
207 command: "apt-get update && apt-get install -qq -y curl gnupg2"
209 name: "Install apt-keys"
211 if [ "<< parameters.version >>" = "master" ]; then
212 curl https://repo.powerdns.com/CBC8B383-pub.asc | apt-key add -
214 curl https://repo.powerdns.com/FD380FBB-pub.asc | apt-key add -
217 name: "Add repository"
219 echo 'deb [arch=amd64] http://repo.powerdns.com/<< parameters.distro >> << parameters.release >>-auth-<< parameters.version>> main' >> /etc/apt/sources.list.d/pdns.list
223 echo 'Package: pdns-*' > /etc/apt/preferences.d/pdns
224 echo 'Pin: origin repo.powerdns.com' >> /etc/apt/preferences.d/pdns
225 echo 'Pin-Priority: 600' >> /etc/apt/preferences.d/pdns
227 name: update apt cache
228 command: apt-get update
231 description: Install .ccache and set $PATH
235 command: apt-get update && apt-get -qq -y install ccache
237 name: Setup ccache in $PATH
238 command: echo 'export PATH=/usr/lib/ccache:$PATH' >> $BASH_ENV
241 description: Store the .ccache directory
248 key: ccache-cache-{{ arch }}-<< parameters.product >>-{{ .Branch }}
252 restore-cache-ccache:
253 description: Restore the .ccache directory
261 name: ensure ca-certificates is installed
262 command: apt-get update && apt-get -qq -y install ca-certificates
265 - ccache-cache-{{ arch }}-<< parameters.product >>-{{ .Branch }}
266 - ccache-cache-{{ arch }}-<< parameters.product >>-
269 description: Install dependencies needed to build the documentation
272 name: Install dependencies
274 apt-get update && apt-get -qq -y install \
291 if [ "${CIRCLE_PROJECT_USERNAME}" = "PowerDNS" -a "${CIRCLE_PROJECT_REPONAME}" = "pdns" -a "${CIRCLE_BRANCH}" = "master" ]; then
292 apt-get update && apt-get -qq -y install \
297 description: Build documentation
302 BUILDER_VERSION=0.0.0-git1 autoreconf -vfi
307 --disable-lua-records \
308 --disable-unit-tests \
309 --without-dynmodules \
314 make -C docs html-docs
315 if [ "${CIRCLE_PROJECT_USERNAME}" = "PowerDNS" -a "${CIRCLE_PROJECT_REPONAME}" = "pdns" -a "${CIRCLE_BRANCH}" = "master" ]; then
316 make -C docs all-docs
319 name: Upload documents
321 if [ "${CIRCLE_PROJECT_USERNAME}" = "PowerDNS" -a "${CIRCLE_PROJECT_REPONAME}" = "pdns" -a "${CIRCLE_BRANCH}" = "master" ]; then
322 rsync -crv --delete --no-p --chmod=g=rwX --exclude '*~' ./doc/html-docs/ doc_powerdns_com@web1.powerdns.com:/srv/www/doc.powerdns.com/authoritative/
323 rsync -crv --no-p --chmod=g=rwX --exclude '*~' ./doc/html-docs.tar.bz2 doc_powerdns_com@web1.powerdns.com:/srv/www/doc.powerdns.com/authoritative/
324 rsync -crv --no-p --chmod=g=rwX --exclude '*~' ./doc/PowerDNS-Authoritative.pdf doc_powerdns_com@web1.powerdns.com:/srv/www/doc.powerdns.com/authoritative/
328 description: Build Recursor documentation
333 BUILDER_VERSION=0.0.0-git1 autoreconf -vfi
334 working_directory: ~/project/pdns/recursordist
339 --disable-unit-tests \
341 working_directory: ~/project/pdns/recursordist
346 if [ "${CIRCLE_PROJECT_USERNAME}" = "PowerDNS" -a "${CIRCLE_PROJECT_REPONAME}" = "pdns" -a "${CIRCLE_BRANCH}" = "master" ]; then
349 working_directory: ~/project/pdns/recursordist
351 name: Upload documents
352 working_directory: ~/project/pdns/recursordist
354 if [ "${CIRCLE_PROJECT_USERNAME}" = "PowerDNS" -a "${CIRCLE_PROJECT_REPONAME}" = "pdns" -a "${CIRCLE_BRANCH}" = "master" ]; then
355 rsync -crv --delete --no-p --chmod=g=rwX --exclude '*~' html-docs/ doc_powerdns_com@web1.powerdns.com:/srv/www/doc.powerdns.com/recursor/
356 rsync -crv --no-p --chmod=g=rwX --exclude '*~' html-docs.tar.bz2 doc_powerdns_com@web1.powerdns.com:/srv/www/doc.powerdns.com/recursor/
357 rsync -crv --no-p --chmod=g=rwX --exclude '*~' PowerDNS-Recursor.pdf doc_powerdns_com@web1.powerdns.com:/srv/www/doc.powerdns.com/recursor/
361 description: Build dnsdist documentation
366 BUILDER_VERSION=0.0.0-git1 autoreconf -vfi
367 working_directory: ~/project/pdns/dnsdistdist
372 --disable-unit-tests \
374 working_directory: ~/project/pdns/dnsdistdist
379 working_directory: ~/project/pdns/dnsdistdist
381 name: Upload documents
382 working_directory: ~/project/pdns/dnsdistdist
384 if [ "${CIRCLE_PROJECT_USERNAME}" = "PowerDNS" -a "${CIRCLE_PROJECT_REPONAME}" = "pdns" -a "${CIRCLE_BRANCH}" = "master" ]; then
385 rsync -crv --delete --no-p --chmod=g=rwX --exclude '*~' html-docs/ dnsdist_org@web1.powerdns.com:/srv/www/dnsdist.org
386 rsync -crv --no-p --chmod=g=rwX --exclude '*~' html-docs.tar.bz2 dnsdist_org@web1.powerdns.com:/srv/www/dnsdist.org
387 rsync -crv --no-p --chmod=g=rwX --exclude '*~' dnsdist.pdf dnsdist_org@web1.powerdns.com:/srv/www/dnsdist.org
393 - image: debian:stretch
397 - install-auth-dev-deps
398 - restore-cache-ccache:
402 command: BUILDER_VERSION=0.0.0-git1 autoreconf -vfi
406 CFLAGS="-O1 -Werror=vla" \
407 CXXFLAGS="-O1 -Werror=vla" \
409 --disable-lua-records \
410 --with-modules='bind lmdb ldap gmysql gsqlite3 gpgsql godbc mydns random tinydns' \
414 --prefix=/opt/pdns-auth
421 name: Install the binaries
422 command: make install
423 - persist_to_workspace:
428 test-auth-regress-odbc-sqlite3:
430 - image: debian:stretch
434 name: Configure ODBC for sqlite
436 cat >> ~/.odbc.ini \<<- __EOF__
439 Database = ${PWD}/regression-tests/pdns.sqlite3
442 Database = ${PWD}/regression-tests/pdns.sqlite32
445 name: Install ODBC deps
447 apt-get install -qq -y \
452 name: Set up sqlite3 odbc testing
453 command: echo 'export GODBC_SQLITE3_DSN=pdns-sqlite3-1' > ./vars
454 workdir: ~/project/regression-tests
456 context: godbc_sqlite3-nsec3
457 doroot: false # Broken at the moment
459 test-auth-regress-odbc-mssql:
461 - image: debian:stretch
462 - image: mcr.microsoft.com/mssql/server:2019-CTP2.2-ubuntu
465 - SA_PASSWORD: 'SAsa12%%'
469 name: Install ODBC deps
471 apt-get install -qq -y \
476 name: set up mssql odbc
478 cat >> ~/.odbc.ini \<<- __EOF__
486 [pdns-mssql-docker-nodb]
494 command: cat /usr/share/tdsodbc/odbcinst.ini >> /etc/odbcinst.ini
496 name: create database
497 command: echo 'create database pdns' | isql -v pdns-mssql-docker-nodb sa SAsa12%%
499 name: Set up mssql odbc testing
500 command: echo 'export GODBC_MSSQL_PASSWORD=SAsa12%% GODBC_MSSQL_USERNAME=sa GODBC_MSSQL_DSN=pdns-mssql-docker' > ./vars
501 workdir: ~/project/regression-tests
503 context: godbc_mssql-nodnssec
504 skip: 8bit-txt-unescaped
507 skip: 8bit-txt-unescaped
509 context: godbc_mssql-nsec3
510 skip: 8bit-txt-unescaped
512 context: godbc_mssql-nsec3-optout
513 skip: 8bit-txt-unescaped
515 context: godbc_mssql-nsec3-narrow
516 skip: 8bit-txt-unescaped
518 test-auth-regress-gsqlite3:
520 - image: debian:stretch
524 command: apt-get install -qq -y sqlite3
526 context: gsqlite3-nodnssec-both
528 context: gsqlite3-both
530 context: gsqlite3-nsec3-both
532 context: gsqlite3-nsec3-optout-both
534 context: gsqlite3-nsec3-narrow
536 test-auth-regress-bind:
538 - image: debian:stretch
539 - image: circleci/mysql:5 # for the hybrid test
543 command: apt-get install -qq -y sqlite3
547 context: bind-dnssec-both
549 context: bind-dnssec-nsec3-both
551 context: bind-dnssec-nsec3-optout-both
553 context: bind-dnssec-nsec3-narrow
555 command: apt-get install -qq -y default-mysql-client
558 cat >> ~/.my.cnf \<<- __EOF__
563 context: bind-hybrid-nsec3
565 test-auth-regress-mydns:
567 - image: debian:stretch
568 - image: circleci/mysql:5
572 command: apt-get install -qq -y default-mysql-client
575 cat >> ~/.my.cnf \<<- __EOF__
583 test-auth-regress-gmysql:
585 - image: debian:stretch
586 - image: circleci/mysql:5
590 command: apt-get install -qq -y default-mysql-client
593 cat >> ~/.my.cnf \<<- __EOF__
598 context: gmysql-nodnssec-both
602 context: gmysql-nsec3-both
604 context: gmysql-nsec3-optout-both
606 context: gmysql-nsec3-narrow
608 test-auth-regress-gpgsql:
610 - image: debian:stretch
611 - image: circleci/postgres:9
617 command: apt-get install -qq -y postgresql-client
619 name: Use TCP for Postgresql connections
621 cat >> ./vars \<<- __EOF__
622 export PGHOST=127.0.0.1
625 workdir: ~/project/regression-tests
627 context: gpgsql-nodnssec-both
631 context: gpgsql-nsec3-both
633 context: gpgsql-nsec3-optout-both
635 context: gpgsql-nsec3-narrow
637 test-auth-regress-ldap:
639 - image: debian:stretch
641 LDAPHOST: ldap://ldapserver/
642 - image: powerdns/ldap-regress:1.2.4-0 # OpenLDAP 2.4.47
644 command: '--loglevel debug'
649 - run: DEBIAN_FRONTEND=noninteractive apt-get install -qq -y ldap-utils
660 test-auth-regress-tinydns:
662 - image: debian:stretch
669 test-auth-regress-lmdb:
671 - image: debian:stretch
674 - run: apt-get install -y -qq jq curl
676 context: lmdb-nodnssec-both
680 context: lmdb-nsec3-both
682 context: lmdb-nsec3-optout-both
684 context: lmdb-nsec3-narrow
686 test-auth-algorithms:
688 - image: debian:stretch
692 name: Test all algorithms
693 command: /opt/pdns-auth/bin/pdnsutil test-algorithms
697 - image: debian:stretch
700 - run: apt-get -y -qq install virtualenv sqlite3
703 workdir: ~/project/regression-tests.api
705 PDNSSERVER="/opt/pdns-auth/sbin/pdns_server" \
706 PDNSUTIL="/opt/pdns-auth/bin/pdnsutil" \
707 SDIG="/opt/pdns-auth/bin/sdig" \
708 ZONE2SQL="/opt/pdns-auth/bin/zone2sql" \
709 ./runtests authoritative
713 - image: debian:stretch
715 - restore-cache-ccache:
718 name: Install dependencies
720 apt-get update && apt-get -qq --no-install-recommends install \
745 command: BUILDER_VERSION=0.0.0-git1 autoreconf -vfi
746 working_directory: ~/project/pdns/recursordist
750 CFLAGS="-O1 -Werror=vla" \
751 CXXFLAGS="-O1 -Werror=vla" \
753 --enable-unit-tests \
754 --prefix=/opt/pdns-recursor \
758 --with-protobuf=yes \
760 working_directory: ~/project/pdns/recursordist
764 working_directory: ~/project/pdns/recursordist
769 command: make check || (cat test-suite.log; false)
770 working_directory: ~/project/pdns/recursordist
772 name: Install resulting binaries
773 command: make install
774 working_directory: ~/project/pdns/recursordist
775 - persist_to_workspace:
780 test-recursor-regression:
782 - image: debian:stretch
785 - run: apt-get --no-install-recommends install -qq -y pdns-server pdns-backend-bind pdns-tools daemontools authbind jq libfaketime lua-posix moreutils bc virtualenv protobuf-compiler
786 - install-recursor-deps
788 name: Set up authbind
790 touch /etc/authbind/byport/53
791 chmod 755 /etc/authbind/byport/53
796 name: Run regression tests
799 PDNSRECURSOR=/opt/pdns-recursor/sbin/pdns_recursor \
800 RECCONTROL=/opt/pdns-recursor/bin/rec_control \
801 ./build-scripts/test-recursor
805 - image: debian:stretch
808 - run: apt-get --no-install-recommends install -qq -y pdns-tools moreutils time
809 - install-recursor-deps
814 name: Get the majestic million list
815 workdir: ~/project/regression-tests
817 apt-get install -qq -y unzip && \
818 curl -LO http://s3-us-west-1.amazonaws.com/umbrella-static/top-1m.csv.zip && \
819 unzip top-1m.csv.zip -d .
823 DNSBULKTEST=/usr/bin/dnsbulktest \
824 RECURSOR=/opt/pdns-recursor/sbin/pdns_recursor \
827 ./timestamp ./recursor-test 5300 50000 || \
828 (cat recursor.log; false)
829 workdir: ~/project/regression-tests
833 - image: debian:stretch
836 - run: apt-get --no-install-recommends install -qq -y virtualenv pdns-tools
837 - install-recursor-deps
843 workdir: ~/project/regression-tests.api
845 PDNSRECURSOR="/opt/pdns-recursor/sbin/pdns_recursor" \
850 - image: debian:stretch
858 - image: debian:stretch
862 - build-recursor-docs
866 - image: debian:stretch
880 - test-auth-algorithms:
883 - test-auth-regress-odbc-sqlite3:
886 - test-auth-regress-odbc-mssql:
889 - test-auth-regress-gmysql:
892 - test-auth-regress-mydns:
895 - test-auth-regress-bind:
898 - test-auth-regress-gsqlite3:
901 - test-auth-regress-gpgsql:
904 - test-auth-regress-lmdb:
907 - test-auth-regress-ldap:
910 - test-auth-regress-tinydns:
914 - test-recursor-regression:
917 - test-recursor-bulk:
927 - build-recursor-docs