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
29 install-coverity-tools:
30 description: Install the coverity tools to /usr/local
33 name: Install Coverity tools
34 command: curl -s https://scan.coverity.com/download/linux64 --data "token=${COVERITY_TOKEN}&project=${COVERITY_PROJECT}" | gunzip | tar xvf /dev/stdin --strip-components=2 --no-same-owner -C /usr/local
37 description: Prepare the environment for auth regression tests
40 name: ensure ca-certificates is installed
41 command: apt-get update && apt-get -qq -y install ca-certificates
46 name: Install test dependencies
48 apt-get -y -qq install \
51 default-jre-headless \
57 name: Install jdnssectools
59 if [ ! -e /usr/bin/jdnssec-verifyzone ]; then
60 apt-get install -qq -y wget
61 wget https://github.com/dblacka/jdnssec-tools/releases/download/0.14/jdnssec-tools-0.14.tar.gz
62 tar xfz jdnssec-tools-0.14.tar.gz --strip-components=1 -C /
63 rm jdnssec-tools-0.14.tar.gz
67 name: Allow missing tools in verify-dnssec-zone
68 command: touch regression-tests/tests/verify-dnssec-zone/allow-missing
71 description: Run one auth regression context
87 default: "/opt/pdns-auth/"
90 workdir: ~/project/regression-tests
91 name: Run << parameters.context >> tests
93 [ -e ./vars ] && . ./vars
95 for t in << parameters.skip >>
99 PDNS=<< parameters.prefix >>sbin/pdns_server \
100 PDNS2=<< parameters.prefix >>sbin/pdns_server \
101 SDIG=<< parameters.prefix >>bin/sdig \
102 NOTIFY=<< parameters.prefix >>bin/pdns_notify \
103 NSEC3DIG=<< parameters.prefix >>bin/nsec3dig \
104 SAXFR=<< parameters.prefix >>bin/saxfr \
105 ZONE2SQL=<< parameters.prefix >>bin/zone2sql \
106 ZONE2LDAP=<< parameters.prefix >>bin/zone2ldap \
107 PDNSUTIL=<< parameters.prefix >>bin/pdnsutil \
108 PDNSCONTROL=<< parameters.prefix >>bin/pdns_control \
109 ./start-test-stop 5300 << parameters.context >>
111 condition: << parameters.doroot >>
114 workdir: ~/project/regression-tests.rootzone
115 name: Run << parameters.context >> tests for the root zone
117 [ -e ../regression-tests/vars ] && . ../regression-tests/vars
119 for t in << parameters.rootskip >>
123 PDNS=<< parameters.prefix >>sbin/pdns_server \
124 PDNS2=<< parameters.prefix >>sbin/pdns_server \
125 SDIG=<< parameters.prefix >>bin/sdig \
126 NOTIFY=<< parameters.prefix >>bin/pdns_notify \
127 NSEC3DIG=<< parameters.prefix >>bin/nsec3dig \
128 SAXFR=<< parameters.prefix >>bin/saxfr \
129 ZONE2SQL=<< parameters.prefix >>bin/zone2sql \
130 ZONE2LDAP=<< parameters.prefix >>bin/zone2ldap \
131 PDNSUTIL=<< parameters.prefix >>bin/pdnsutil \
132 PDNSCONTROL=<< parameters.prefix >>bin/pdns_control \
133 ./start-test-stop 5300 << parameters.context >>
135 install-recursor-deps:
136 description: "Install all libraries needed for the recursor"
138 - run: apt-get update
141 apt-get install -qq -y \
151 description: Install all libraries needed to run the auth
154 apt-get install -qq -y --no-install-recommends \
164 default-libmysqlclient-dev \
167 install-auth-dev-deps:
168 description: Install all packages needed to build the auth
170 - run: apt-get update
173 apt-get install -qq -y --no-install-recommends \
179 default-libmysqlclient-dev \
202 description: "Add the debian repo for the auth"
215 name: "Install dependencies"
216 command: "apt-get update && apt-get install -qq -y curl gnupg2"
218 name: "Install apt-keys"
220 if [ "<< parameters.version >>" = "master" ]; then
221 curl https://repo.powerdns.com/CBC8B383-pub.asc | apt-key add -
223 curl https://repo.powerdns.com/FD380FBB-pub.asc | apt-key add -
226 name: "Add repository"
228 echo 'deb [arch=amd64] http://repo.powerdns.com/<< parameters.distro >> << parameters.release >>-auth-<< parameters.version>> main' >> /etc/apt/sources.list.d/pdns.list
232 echo 'Package: pdns-*' > /etc/apt/preferences.d/pdns
233 echo 'Pin: origin repo.powerdns.com' >> /etc/apt/preferences.d/pdns
234 echo 'Pin-Priority: 600' >> /etc/apt/preferences.d/pdns
236 name: update apt cache
237 command: apt-get update
240 description: Install .ccache and set $PATH
244 command: apt-get update && apt-get -qq -y install ccache
246 name: Setup ccache in $PATH
247 command: echo 'export PATH=/usr/lib/ccache:$PATH' >> $BASH_ENV
250 description: Store the .ccache directory
257 key: ccache-cache-{{ arch }}-<< parameters.product >>-{{ .Branch }}
261 restore-cache-ccache:
262 description: Restore the .ccache directory
270 name: ensure ca-certificates is installed
271 command: apt-get update && apt-get -qq -y install ca-certificates
274 - ccache-cache-{{ arch }}-<< parameters.product >>-{{ .Branch }}
275 - ccache-cache-{{ arch }}-<< parameters.product >>-
280 - image: debian:stretch
284 - install-auth-dev-deps
285 - restore-cache-ccache:
289 command: BUILDER_VERSION=0.0.0-git1 autoreconf -vfi
293 CFLAGS="-O1 -Werror=vla" \
294 CXXFLAGS="-O1 -Werror=vla" \
296 --disable-lua-records \
297 --with-modules='bind lmdb ldap gmysql gsqlite3 gpgsql godbc mydns random tinydns' \
301 --prefix=/opt/pdns-auth
308 name: Install the binaries
309 command: make install
310 - persist_to_workspace:
315 test-auth-regress-odbc-sqlite3:
317 - image: debian:stretch
321 name: Configure ODBC for sqlite
323 cat >> ~/.odbc.ini \<<- __EOF__
326 Database = ${PWD}/regression-tests/pdns.sqlite3
329 Database = ${PWD}/regression-tests/pdns.sqlite32
332 name: Install ODBC deps
334 apt-get install -qq -y \
339 name: Set up sqlite3 odbc testing
340 command: echo 'export GODBC_SQLITE3_DSN=pdns-sqlite3-1' > ./vars
341 workdir: ~/project/regression-tests
343 context: godbc_sqlite3-nsec3
344 doroot: false # Broken at the moment
346 test-auth-regress-odbc-mssql:
348 - image: debian:stretch
349 - image: mcr.microsoft.com/mssql/server:2017-GA-ubuntu
352 - SA_PASSWORD: 'SAsa12%%'
356 name: Install ODBC deps
358 apt-get install -qq -y \
363 name: set up mssql odbc
365 cat >> ~/.odbc.ini \<<- __EOF__
373 [pdns-mssql-docker-nodb]
381 command: cat /usr/share/tdsodbc/odbcinst.ini >> /etc/odbcinst.ini
383 name: create database
384 command: echo 'create database pdns' | isql -v pdns-mssql-docker-nodb sa SAsa12%%
386 name: Set up mssql odbc testing
387 command: echo 'export GODBC_MSSQL_PASSWORD=SAsa12%% GODBC_MSSQL_USERNAME=sa GODBC_MSSQL_DSN=pdns-mssql-docker' > ./vars
388 workdir: ~/project/regression-tests
390 context: godbc_mssql-nodnssec
391 skip: 8bit-txt-unescaped
394 skip: 8bit-txt-unescaped
396 context: godbc_mssql-nsec3
397 skip: 8bit-txt-unescaped
399 context: godbc_mssql-nsec3-optout
400 skip: 8bit-txt-unescaped
402 context: godbc_mssql-nsec3-narrow
403 skip: 8bit-txt-unescaped
405 test-auth-regress-gsqlite3:
407 - image: debian:stretch
411 command: apt-get install -qq -y sqlite3
413 context: gsqlite3-nodnssec-both
415 context: gsqlite3-both
417 context: gsqlite3-nsec3-both
419 context: gsqlite3-nsec3-optout-both
421 context: gsqlite3-nsec3-narrow
423 test-auth-regress-bind:
425 - image: debian:stretch
426 - image: circleci/mysql:5 # for the hybrid test
430 command: apt-get install -qq -y sqlite3
434 context: bind-dnssec-both
436 context: bind-dnssec-nsec3-both
438 context: bind-dnssec-nsec3-optout-both
440 context: bind-dnssec-nsec3-narrow
442 command: apt-get install -qq -y default-mysql-client
445 cat >> ~/.my.cnf \<<- __EOF__
450 context: bind-hybrid-nsec3
452 test-auth-regress-mydns:
454 - image: debian:stretch
455 - image: circleci/mysql:5
459 command: apt-get install -qq -y default-mysql-client
462 cat >> ~/.my.cnf \<<- __EOF__
470 test-auth-regress-gmysql:
472 - image: debian:stretch
473 - image: circleci/mysql:5
477 command: apt-get install -qq -y default-mysql-client
480 cat >> ~/.my.cnf \<<- __EOF__
485 context: gmysql-nodnssec-both
489 context: gmysql-nsec3-both
491 context: gmysql-nsec3-optout-both
493 context: gmysql-nsec3-narrow
495 test-auth-regress-gpgsql:
497 - image: debian:stretch
498 - image: circleci/postgres:9
504 command: apt-get install -qq -y postgresql-client
506 name: Use TCP for Postgresql connections
508 cat >> ./vars \<<- __EOF__
509 export PGHOST=127.0.0.1
512 workdir: ~/project/regression-tests
514 context: gpgsql-nodnssec-both
518 context: gpgsql-nsec3-both
520 context: gpgsql-nsec3-optout-both
522 context: gpgsql-nsec3-narrow
524 test-auth-regress-ldap:
526 - image: debian:stretch
528 LDAPHOST: ldap://ldapserver/
529 - image: powerdns/ldap-regress:1.2.4-0 # OpenLDAP 2.4.47
531 command: '--loglevel debug'
536 - run: DEBIAN_FRONTEND=noninteractive apt-get install -qq -y ldap-utils
547 test-auth-regress-tinydns:
549 - image: debian:stretch
556 test-auth-regress-lmdb:
558 - image: debian:stretch
561 - run: apt-get install -y -qq jq curl
563 context: lmdb-nodnssec-both
567 context: lmdb-nsec3-both
569 context: lmdb-nsec3-optout-both
571 context: lmdb-nsec3-narrow
573 test-auth-algorithms:
575 - image: debian:stretch
579 name: Test all algorithms
580 command: /opt/pdns-auth/bin/pdnsutil test-algorithms
584 - image: debian:stretch
587 - run: apt-get -y -qq install virtualenv sqlite3
590 workdir: ~/project/regression-tests.api
592 PDNSSERVER="/opt/pdns-auth/sbin/pdns_server" \
593 PDNSUTIL="/opt/pdns-auth/bin/pdnsutil" \
594 SDIG="/opt/pdns-auth/bin/sdig" \
595 ZONE2SQL="/opt/pdns-auth/bin/zone2sql" \
596 ./runtests authoritative
600 - image: debian:stretch
602 - restore-cache-ccache:
605 name: Install dependencies
607 apt-get update && apt-get -qq --no-install-recommends install \
632 command: BUILDER_VERSION=0.0.0-git1 autoreconf -vfi
633 working_directory: ~/project/pdns/recursordist
637 CFLAGS="-O1 -Werror=vla" \
638 CXXFLAGS="-O1 -Werror=vla" \
640 --enable-unit-tests \
642 --prefix=/opt/pdns-recursor \
646 --with-protobuf=yes \
648 working_directory: ~/project/pdns/recursordist
652 working_directory: ~/project/pdns/recursordist
657 command: make check || (cat test-suite.log; false)
658 working_directory: ~/project/pdns/recursordist
660 name: Install resulting binaries
661 command: make install
662 working_directory: ~/project/pdns/recursordist
663 - persist_to_workspace:
668 test-recursor-regression:
670 - image: debian:stretch
673 - 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
674 - install-recursor-deps
676 name: Set up authbind
678 touch /etc/authbind/byport/53
679 chmod 755 /etc/authbind/byport/53
684 name: Run regression tests
687 PDNSRECURSOR=/opt/pdns-recursor/sbin/pdns_recursor \
688 RECCONTROL=/opt/pdns-recursor/bin/rec_control \
689 ./build-scripts/test-recursor
693 - image: debian:stretch
696 - run: apt-get --no-install-recommends install -qq -y pdns-tools moreutils time
697 - install-recursor-deps
702 name: Get the majestic million list
703 workdir: ~/project/regression-tests
705 apt-get install -qq -y unzip && \
706 curl -LO http://s3-us-west-1.amazonaws.com/umbrella-static/top-1m.csv.zip && \
707 unzip top-1m.csv.zip -d .
711 DNSBULKTEST=/usr/bin/dnsbulktest \
712 RECURSOR=/opt/pdns-recursor/sbin/pdns_recursor \
715 ./timestamp ./recursor-test 5300 50000 || \
716 (cat recursor.log; false)
717 workdir: ~/project/regression-tests
721 - image: debian:stretch
724 - run: apt-get --no-install-recommends install -qq -y virtualenv pdns-tools
725 - install-recursor-deps
731 workdir: ~/project/regression-tests.api
733 PDNSRECURSOR="/opt/pdns-recursor/sbin/pdns_recursor" \
738 - image: debian:stretch
740 - install-auth-dev-deps
741 - install-coverity-tools
745 command: BUILDER_VERSION=0.0.0-git1 autoreconf -vfi
749 CFLAGS="-O1 -Werror=vla" \
750 CXXFLAGS="-O1 -Werror=vla" \
752 --disable-lua-records \
753 --with-modules='bind lmdb ldap gmysql gsqlite3 gpgsql godbc mydns random tinydns' \
757 --prefix=/opt/pdns-auth
760 command: /usr/local/bin/cov-build --dir cov-int make -j2 -k
762 name: Create Coverity tarball
763 command: tar caf auth.tar.bz2 cov-int
765 name: Upload tarball to coverity
767 curl --form token=${COVERITY_TOKEN} \
768 --form email="${COVERITY_EMAIL}" \
769 --form file=@auth.tar.bz2 \
770 --form version="$(./builder-support/gen-version)" \
771 --form description="master build" \
772 https://scan.coverity.com/builds?project=${COVERITY_PROJECT}
776 - image: debian:stretch
779 name: Install dependencies
781 apt-get update && apt-get -qq --no-install-recommends install \
808 - install-coverity-tools
812 command: BUILDER_VERSION=0.0.0-git1 autoreconf -vfi
813 working_directory: ~/project/pdns/dnsdistdist
817 CFLAGS="-O1 -Werror=vla" \
818 CXXFLAGS="-O1 -Werror=vla" \
821 --disable-unit-tests \
824 --enable-dns-over-tls \
825 --prefix=/opt/dnsdist \
829 --with-protobuf=yes \
831 working_directory: ~/project/pdns/dnsdistdist
834 command: /usr/local/bin/cov-build --dir cov-int make -j2 -k
835 working_directory: ~/project/pdns/dnsdistdist
837 name: Create Coverity tarball
838 command: tar caf dnsdist.tar.bz2 cov-int
839 working_directory: ~/project/pdns/dnsdistdist
841 name: Upload tarball to coverity
843 curl --form token=${COVERITY_TOKEN} \
844 --form email="${COVERITY_EMAIL}" \
845 --form file=@pdns/dnsdistdist/dnsdist.tar.bz2 \
846 --form version="$(./builder-support/gen-version)" \
847 --form description="master build" \
848 https://scan.coverity.com/builds?project=${COVERITY_PROJECT}
852 - image: debian:stretch
855 name: Install dependencies
857 apt-get update && apt-get -qq --no-install-recommends install \
880 - install-coverity-tools
884 command: BUILDER_VERSION=0.0.0-git1 autoreconf -vfi
885 working_directory: ~/project/pdns/recursordist
889 CFLAGS="-O1 -Werror=vla" \
890 CXXFLAGS="-O1 -Werror=vla" \
893 --disable-unit-tests \
894 --prefix=/opt/pdns-recursor \
898 --with-protobuf=yes \
900 working_directory: ~/project/pdns/recursordist
903 command: /usr/local/bin/cov-build --dir cov-int make -j2 -k
904 working_directory: ~/project/pdns/recursordist
906 name: Create Coverity tarball
907 command: tar caf recursor.tar.bz2 cov-int
908 working_directory: ~/project/pdns/recursordist
910 name: Upload tarball to coverity
912 curl --form token=${COVERITY_TOKEN} \
913 --form email="${COVERITY_EMAIL}" \
914 --form file=@pdns/recursordist/recursor.tar.bz2 \
915 --form version="$(./builder-support/gen-version)" \
916 --form description="master build" \
917 https://scan.coverity.com/builds?project=${COVERITY_PROJECT}
930 context: auth-coverity
932 context: dnsdist-coverity
934 context: recursor-coverity
942 - test-auth-algorithms:
945 - test-auth-regress-odbc-sqlite3:
948 - test-auth-regress-odbc-mssql:
951 - test-auth-regress-gmysql:
954 - test-auth-regress-mydns:
957 - test-auth-regress-bind:
960 - test-auth-regress-gsqlite3:
963 - test-auth-regress-gpgsql:
966 - test-auth-regress-lmdb:
969 - test-auth-regress-ldap:
972 - test-auth-regress-tinydns:
976 - test-recursor-regression:
979 - test-recursor-bulk: