]> git.ipfire.org Git - thirdparty/pdns.git/blob - .circleci/config.yml
Merge pull request #8288 from omoerbeek/rec-enable-dnstap
[thirdparty/pdns.git] / .circleci / config.yml
1 version: 2.1
2
3 commands:
4 checkout-shallow:
5 description: "Do a shallow checkout of the repository"
6 steps:
7 - run:
8 name: Install git and openssh
9 command: apt-get update && apt-get -qq -y install openssh-client git
10 - run:
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
13 - run:
14 name: Clone the repo
15 command: |
16 mkdir -p /opt/project
17 if [ -n "$CIRCLE_PR_NUMBER" ]
18 then
19 echo === Checking out PR "$CIRCLE_PR_NUMBER" from "$CIRCLE_REPOSITORY_URL"
20 git clone --depth 1 $CIRCLE_REPOSITORY_URL /opt/project
21 cd /opt/project
22 git fetch --depth 1 origin +refs/pull/${CIRCLE_PR_NUMBER}/merge
23 git checkout -qf FETCH_HEAD
24 else
25 echo === Checking out branch "${CIRCLE_BRANCH}" from "$CIRCLE_REPOSITORY_URL"
26 git clone --depth 1 --branch $CIRCLE_BRANCH $CIRCLE_REPOSITORY_URL /opt/project
27 fi
28 cd /opt/project
29 git show -s
30
31 get-workspace:
32 description: "Attach workspace to /opt and symlink checkout into home"
33 steps:
34 - run:
35 name: ensure ca-certificates is installed
36 command: apt-get update && apt-get -qq -y install ca-certificates
37 - attach_workspace:
38 at: /opt
39 - run:
40 name: symlink checkout into home
41 command: rmdir ~/project && ln -s /opt/project ~/project
42 - run:
43 name: include $BASH_ENV for both interactive and non-interactive shells
44 command: echo '. $BASH_ENV' >> $HOME/.bashrc
45
46 install-coverity-tools:
47 description: Install the coverity tools to /usr/local
48 steps:
49 - run:
50 name: Install Coverity tools
51 command: curl -s https://scan.coverity.com/download/linux64 --data "token=${COVERITY_TOKEN}&project=${COVERITY_PROJECT}" | gunzip | tar xvf /dev/stdin --strip-components=1 --no-same-owner -C /usr/local
52
53 add-docs-upload-ssh:
54 description: Add ssh known_hosts fingerprints
55 steps:
56 - run:
57 command: mkdir -p $HOME/.ssh && echo "${DOCS_HOST} ${DOCS_FINGERPRINT}" > $HOME/.ssh/known_hosts
58 - add_ssh_keys:
59 fingerprints:
60 - "3e:0a:aa:2c:30:69:89:f3:eb:17:c1:3f:3b:78:40:7a"
61
62 auth-regress-setup:
63 description: Prepare the environment for auth regression tests
64 steps:
65 - get-workspace
66 - install-auth-deps
67 - run:
68 name: Install test dependencies
69 command: |
70 apt-get -y -qq install \
71 bc \
72 bind9utils \
73 default-jre-headless \
74 dnsutils \
75 ldnsutils \
76 libnet-dns-perl \
77 unbound-host
78 - run:
79 name: Install jdnssectools
80 command: |
81 if [ ! -e $HOME/bin/jdnssec-verifyzone ]; then
82 apt-get install -qq -y wget
83 wget https://github.com/dblacka/jdnssec-tools/releases/download/0.14/jdnssec-tools-0.14.tar.gz
84 tar xfz jdnssec-tools-0.14.tar.gz -C $HOME
85 rm jdnssec-tools-0.14.tar.gz
86 fi
87 echo 'export PATH=$HOME/jdnssec-tools-0.14/bin:$PATH' >> $BASH_ENV
88 - run:
89 name: Allow missing tools in verify-dnssec-zone
90 command: touch regression-tests/tests/verify-dnssec-zone/allow-missing
91
92 auth-regress:
93 description: Run one auth regression context
94 parameters:
95 skip:
96 type: string
97 default: ""
98 rootskip:
99 type: string
100 default: ""
101 doroot:
102 type: boolean
103 default: true
104 context:
105 type: string
106 default: ""
107 prefix:
108 type: string
109 default: "/opt/pdns-auth/"
110 steps:
111 - run:
112 workdir: ~/project/regression-tests
113 name: Run << parameters.context >> tests
114 command: |
115 [ -e ./vars ] && . ./vars
116 export
117 rm -rf tests/*/skip
118 for t in << parameters.skip >>
119 do
120 touch tests/$t/skip
121 done
122 PDNS=<< parameters.prefix >>sbin/pdns_server \
123 PDNS2=<< parameters.prefix >>sbin/pdns_server \
124 SDIG=<< parameters.prefix >>bin/sdig \
125 NOTIFY=<< parameters.prefix >>bin/pdns_notify \
126 NSEC3DIG=<< parameters.prefix >>bin/nsec3dig \
127 SAXFR=<< parameters.prefix >>bin/saxfr \
128 ZONE2SQL=<< parameters.prefix >>bin/zone2sql \
129 ZONE2LDAP=<< parameters.prefix >>bin/zone2ldap \
130 PDNSUTIL=<< parameters.prefix >>bin/pdnsutil \
131 PDNSCONTROL=<< parameters.prefix >>bin/pdns_control \
132 ./start-test-stop 5300 << parameters.context >>
133 - when:
134 condition: << parameters.doroot >>
135 steps:
136 - run:
137 workdir: ~/project/regression-tests.rootzone
138 name: Run << parameters.context >> tests for the root zone
139 command: |
140 [ -e ../regression-tests/vars ] && . ../regression-tests/vars
141 rm -rf tests/*/skip
142 for t in << parameters.rootskip >>
143 do
144 touch tests/$t/skip
145 done
146 PDNS=<< parameters.prefix >>sbin/pdns_server \
147 PDNS2=<< parameters.prefix >>sbin/pdns_server \
148 SDIG=<< parameters.prefix >>bin/sdig \
149 NOTIFY=<< parameters.prefix >>bin/pdns_notify \
150 NSEC3DIG=<< parameters.prefix >>bin/nsec3dig \
151 SAXFR=<< parameters.prefix >>bin/saxfr \
152 ZONE2SQL=<< parameters.prefix >>bin/zone2sql \
153 ZONE2LDAP=<< parameters.prefix >>bin/zone2ldap \
154 PDNSUTIL=<< parameters.prefix >>bin/pdnsutil \
155 PDNSCONTROL=<< parameters.prefix >>bin/pdns_control \
156 ./start-test-stop 5300 << parameters.context >>
157
158 install-recursor-deps:
159 description: "Install all libraries needed for the recursor"
160 steps:
161 - run: apt-get update
162 - run:
163 command: |
164 apt-get install -qq -y \
165 libluajit-5.1 \
166 libboost-all-dev \
167 libcap2 \
168 libssl1.1 \
169 libsystemd0 \
170 libsodium23 \
171 libfstrm0 \
172 libprotobuf17
173
174 install-auth-deps:
175 description: Install all libraries needed to run the auth
176 steps:
177 - run: |
178 apt-get install -qq -y --no-install-recommends \
179 libboost-all-dev \
180 libcdb1 \
181 libkrb5-3 \
182 libldap-2.4-2 \
183 liblmdb0 \
184 libpq5 \
185 libssl1.1 \
186 libsodium23 \
187 libsystemd0 \
188 default-libmysqlclient-dev \
189 unixodbc
190
191 install-dnsdist-deps:
192 description: "Install all libraries needed for testing dnsdist"
193 steps:
194 - run: apt-get update
195 - run:
196 command: |
197 apt-get install -qq -y \
198 libluajit-5.1 \
199 libboost-all-dev \
200 libcap2 \
201 libcdb1 \
202 libcurl4-openssl-dev \
203 libfstrm0 \
204 libh2o-evloop0.13 \
205 liblmdb0 \
206 libprotobuf17 \
207 libre2-5 \
208 libssl-dev \
209 libsystemd0 \
210 libsodium23 \
211 protobuf-compiler \
212 virtualenv
213
214 install-ixfrdist-deps:
215 description: "Install all libraries needed for testing ixfrdist"
216 steps:
217 - run: apt-get update
218 - run:
219 command: |
220 apt-get install -qq -y \
221 git \
222 libboost-all-dev \
223 libsystemd0 \
224 libyaml-cpp0.6 \
225 virtualenv
226
227 install-auth-dev-deps:
228 description: Install all packages needed to build the auth
229 steps:
230 - run: apt-get update
231 - run:
232 command: |
233 apt-get install -qq -y --no-install-recommends \
234 autoconf \
235 automake \
236 bison \
237 bzip2 \
238 curl \
239 default-libmysqlclient-dev \
240 flex \
241 g++ \
242 git \
243 libboost-all-dev \
244 libcdb-dev \
245 libkrb5-dev \
246 libldap2-dev \
247 liblmdb-dev \
248 libpq-dev \
249 libsodium-dev \
250 libsqlite3-dev \
251 libssl-dev \
252 libsystemd-dev \
253 libtool \
254 libyaml-cpp-dev \
255 make \
256 pkg-config \
257 ragel \
258 sqlite3 \
259 systemd \
260 unixodbc-dev \
261 virtualenv \
262 wget
263
264 add-auth-repo:
265 description: "Add the debian repo for the auth"
266 parameters:
267 version:
268 type: string
269 default: "42"
270 distro:
271 type: string
272 default: "debian"
273 release:
274 type: string
275 default: "buster"
276 steps:
277 - run:
278 name: "Install dependencies"
279 command: "apt-get update && apt-get install -qq -y curl gnupg2"
280 - run:
281 name: "Install apt-keys"
282 command: |
283 if [ "<< parameters.version >>" = "master" ]; then
284 curl https://repo.powerdns.com/CBC8B383-pub.asc | apt-key add -
285 else
286 curl https://repo.powerdns.com/FD380FBB-pub.asc | apt-key add -
287 fi
288 - run:
289 name: "Add repository"
290 command: |
291 echo 'deb [arch=amd64] http://repo.powerdns.com/<< parameters.distro >> << parameters.release >>-auth-<< parameters.version>> main' >> /etc/apt/sources.list.d/pdns.list
292 - run:
293 name: "add pinning"
294 command: |
295 echo 'Package: pdns-*' > /etc/apt/preferences.d/pdns
296 echo 'Pin: origin repo.powerdns.com' >> /etc/apt/preferences.d/pdns
297 echo 'Pin-Priority: 600' >> /etc/apt/preferences.d/pdns
298 - run:
299 name: update apt cache
300 command: apt-get update
301
302 setup-ccache:
303 description: Install .ccache and set $PATH
304 steps:
305 - run:
306 name: Install ccache
307 command: apt-get update && apt-get -qq -y install ccache
308 - run:
309 name: Setup ccache in $PATH
310 command: echo 'export PATH=/usr/lib/ccache:$PATH' >> $BASH_ENV
311
312 save-ccache-cache:
313 description: Store the .ccache directory
314 parameters:
315 product:
316 type: string
317 default: ""
318 steps:
319 - save_cache:
320 key: ccache-cache-{{ arch }}-<< parameters.product >>-{{ .Branch }}
321 paths:
322 - ~/.ccache
323
324 restore-cache-ccache:
325 description: Restore the .ccache directory
326 parameters:
327 product:
328 type: string
329 default: ""
330 steps:
331 - setup-ccache
332 - run:
333 name: ensure ca-certificates is installed
334 command: apt-get update && apt-get -qq -y install ca-certificates
335 - restore_cache:
336 keys:
337 - ccache-cache-{{ arch }}-<< parameters.product >>-{{ .Branch }}
338 - ccache-cache-{{ arch }}-<< parameters.product >>-
339
340 install-doc-deps:
341 description: Install dependencies needed to build the documentation
342 steps:
343 - run:
344 name: Install dependencies
345 command: |
346 apt-get update && apt-get -qq -y install \
347 autoconf \
348 automake \
349 bison \
350 curl \
351 flex \
352 g++ \
353 git \
354 latexmk \
355 libboost-all-dev \
356 libedit-dev \
357 libluajit-5.1-dev \
358 libssl-dev \
359 make \
360 pkg-config \
361 ragel \
362 virtualenv
363 if [ "${CIRCLE_PROJECT_USERNAME}" = "PowerDNS" -a "${CIRCLE_PROJECT_REPONAME}" = "pdns" -a "${CIRCLE_BRANCH}" = "master" ]; then
364 apt-get update && apt-get -qq -y install \
365 texlive-full
366 fi
367
368 build-auth-docs:
369 description: Build documentation
370 steps:
371 - run:
372 name: autoconf
373 command: |
374 BUILDER_VERSION=0.0.0-git1 autoreconf -vfi
375 - run:
376 name: configure
377 command: |
378 ./configure \
379 --disable-lua-records \
380 --disable-unit-tests \
381 --without-dynmodules \
382 --without-modules
383 - run:
384 name: build docs
385 command: |
386 make -C docs html-docs
387 if [ "${CIRCLE_PROJECT_USERNAME}" = "PowerDNS" -a "${CIRCLE_PROJECT_REPONAME}" = "pdns" -a "${CIRCLE_BRANCH}" = "master" ]; then
388 make -C docs all-docs
389 fi
390
391 upload-auth-docs:
392 steps:
393 - run:
394 name: Upload documents
395 command: |
396 if [ "${CIRCLE_PROJECT_USERNAME}" = "PowerDNS" -a "${CIRCLE_PROJECT_REPONAME}" = "pdns" -a "${CIRCLE_BRANCH}" = "master" ]; then
397 rsync -crv --delete --no-p --chmod=g=rwX --exclude '*~' ./docs/html-docs/ docs_powerdns_com@${DOCS_HOST}:/authoritative/
398 rsync -crv --no-p --chmod=g=rwX --exclude '*~' ./docs/html-docs.tar.bz2 docs_powerdns_com@${DOCS_HOST}:/authoritative/
399 rsync -crv --no-p --chmod=g=rwX --exclude '*~' ./docs/PowerDNS-Authoritative.pdf docs_powerdns_com@${DOCS_HOST}:/authoritative/
400 fi
401
402 build-recursor-docs:
403 description: Build Recursor documentation
404 steps:
405 - run:
406 name: autoconf
407 command: |
408 BUILDER_VERSION=0.0.0-git1 autoreconf -vfi
409 working_directory: ~/project/pdns/recursordist
410 - run:
411 name: configure
412 command: |
413 ./configure \
414 --disable-unit-tests \
415 --disable-protobuf
416 working_directory: ~/project/pdns/recursordist
417 - run:
418 name: build docs
419 command: |
420 make html-docs
421 if [ "${CIRCLE_PROJECT_USERNAME}" = "PowerDNS" -a "${CIRCLE_PROJECT_REPONAME}" = "pdns" -a "${CIRCLE_BRANCH}" = "master" ]; then
422 make all-docs
423 fi
424 working_directory: ~/project/pdns/recursordist
425
426 upload-recursor-docs:
427 steps:
428 - run:
429 name: Upload documents
430 working_directory: ~/project/pdns/recursordist
431 command: |
432 if [ "${CIRCLE_PROJECT_USERNAME}" = "PowerDNS" -a "${CIRCLE_PROJECT_REPONAME}" = "pdns" -a "${CIRCLE_BRANCH}" = "master" ]; then
433 rsync -crv --delete --no-p --chmod=g=rwX --exclude '*~' html-docs/ docs_powerdns_com@${DOCS_HOST}:/recursor/
434 rsync -crv --no-p --chmod=g=rwX --exclude '*~' html-docs.tar.bz2 docs_powerdns_com@${DOCS_HOST}:/recursor/
435 rsync -crv --no-p --chmod=g=rwX --exclude '*~' PowerDNS-Recursor.pdf docs_powerdns_com@${DOCS_HOST}:/recursor/
436 fi
437
438 build-dnsdist-docs:
439 description: Build dnsdist documentation
440 steps:
441 - run:
442 name: autoconf
443 command: |
444 BUILDER_VERSION=0.0.0-git1 autoreconf -vfi
445 working_directory: ~/project/pdns/dnsdistdist
446 - run:
447 name: configure
448 command: |
449 ./configure \
450 --disable-unit-tests \
451 --disable-protobuf
452 working_directory: ~/project/pdns/dnsdistdist
453 - run:
454 name: build docs
455 command: |
456 make html-docs
457 if [ "${CIRCLE_PROJECT_USERNAME}" = "PowerDNS" -a "${CIRCLE_PROJECT_REPONAME}" = "pdns" -a "${CIRCLE_BRANCH}" = "master" ]; then
458 make all-docs
459 fi
460 working_directory: ~/project/pdns/dnsdistdist
461
462 upload-dnsdist-docs:
463 steps:
464 - run:
465 name: Upload documents
466 working_directory: ~/project/pdns/dnsdistdist
467 command: |
468 if [ "${CIRCLE_PROJECT_USERNAME}" = "PowerDNS" -a "${CIRCLE_PROJECT_REPONAME}" = "pdns" -a "${CIRCLE_BRANCH}" = "master" ]; then
469 rsync -crv --delete --no-p --chmod=g=rwX --exclude '*~' html-docs/ dnsdist_org@${DOCS_HOST}:
470 rsync -crv --no-p --chmod=g=rwX --exclude '*~' html-docs.tar.bz2 dnsdist_org@${DOCS_HOST}:
471 rsync -crv --no-p --chmod=g=rwX --exclude '*~' dnsdist.pdf dnsdist_org@${DOCS_HOST}:
472 fi
473
474 jobs:
475 checkout:
476 docker:
477 - image: debian:buster
478
479 steps:
480 - checkout-shallow
481 - persist_to_workspace:
482 root: /opt
483 paths:
484 - project
485
486 build-auth:
487 docker:
488 - image: debian:buster
489
490 steps:
491 - get-workspace
492 - install-auth-dev-deps
493 - restore-cache-ccache:
494 product: auth
495 - run:
496 name: autoconf
497 command: BUILDER_VERSION=0.0.0-git1 autoreconf -vfi
498 - run:
499 name: configure
500 command: |
501 CFLAGS="-O1 -Werror=vla -Wformat=2 -Werror=format-security" \
502 CXXFLAGS="-O1 -Werror=vla -Wformat=2 -Werror=format-security -Wp,-D_GLIBCXX_ASSERTIONS" \
503 ./configure \
504 --disable-lua-records \
505 --with-modules='bind lmdb ldap gmysql gsqlite3 gpgsql godbc mydns random tinydns' \
506 --enable-systemd \
507 --enable-tools \
508 --with-lmdb=/usr \
509 --with-libsodium \
510 --prefix=/opt/pdns-auth \
511 --enable-ixfrdist
512 - run:
513 name: build
514 command: make -j3 -k
515 - save-ccache-cache:
516 product: auth
517 - run:
518 name: Install the binaries
519 command: make install
520 - persist_to_workspace:
521 root: /opt
522 paths:
523 - pdns-auth
524
525 test-auth-regress-odbc-sqlite3:
526 docker:
527 - image: debian:buster
528 steps:
529 - auth-regress-setup
530 - run:
531 name: Configure ODBC for sqlite
532 command: |
533 cat >> ~/.odbc.ini \<<- __EOF__
534 [pdns-sqlite3-1]
535 Driver = SQLite3
536 Database = ${PWD}/regression-tests/pdns.sqlite3
537 [pdns-sqlite3-2]
538 Driver = SQLite3
539 Database = ${PWD}/regression-tests/pdns.sqlite32
540 __EOF__
541 - run:
542 name: Install ODBC deps
543 command: |
544 apt-get install -qq -y \
545 unixodbc \
546 libsqliteodbc \
547 sqlite3
548 - run:
549 name: Set up sqlite3 odbc testing
550 command: echo 'export GODBC_SQLITE3_DSN=pdns-sqlite3-1' > ./vars
551 workdir: ~/project/regression-tests
552 - auth-regress:
553 context: godbc_sqlite3-nsec3
554 doroot: false # Broken at the moment
555
556 test-auth-regress-odbc-mssql:
557 docker:
558 - image: debian:buster
559 - image: mcr.microsoft.com/mssql/server:2017-GA-ubuntu
560 environment:
561 - ACCEPT_EULA: Y
562 - SA_PASSWORD: 'SAsa12%%'
563 steps:
564 - auth-regress-setup
565 - run:
566 name: Install ODBC deps
567 command: |
568 apt-get install -qq -y \
569 freetds-bin \
570 tdsodbc \
571 unixodbc
572 - run:
573 name: set up mssql odbc
574 command: |
575 cat >> ~/.odbc.ini \<<- __EOF__
576 [pdns-mssql-docker]
577 Driver=FreeTDS
578 Trace=No
579 Server=127.0.0.1
580 Port=1433
581 Database=pdns
582 TDS_Version=7.1
583 [pdns-mssql-docker-nodb]
584 Driver=FreeTDS
585 Trace=No
586 Server=127.0.0.1
587 Port=1433
588 TDS_Version=7.1
589 __EOF__
590 - run:
591 command: cat /usr/share/tdsodbc/odbcinst.ini >> /etc/odbcinst.ini
592 - run:
593 name: create database
594 command: echo 'create database pdns' | isql -v pdns-mssql-docker-nodb sa SAsa12%%
595 - run:
596 name: Set up mssql odbc testing
597 command: echo 'export GODBC_MSSQL_PASSWORD=SAsa12%% GODBC_MSSQL_USERNAME=sa GODBC_MSSQL_DSN=pdns-mssql-docker' > ./vars
598 workdir: ~/project/regression-tests
599 - auth-regress:
600 context: godbc_mssql-nodnssec
601 skip: 8bit-txt-unescaped
602 - auth-regress:
603 context: godbc_mssql
604 skip: 8bit-txt-unescaped
605 - auth-regress:
606 context: godbc_mssql-nsec3
607 skip: 8bit-txt-unescaped
608 - auth-regress:
609 context: godbc_mssql-nsec3-optout
610 skip: 8bit-txt-unescaped
611 - auth-regress:
612 context: godbc_mssql-nsec3-narrow
613 skip: 8bit-txt-unescaped
614
615 test-auth-regress-gsqlite3:
616 docker:
617 - image: debian:buster
618 steps:
619 - auth-regress-setup
620 - run:
621 command: apt-get install -qq -y sqlite3
622 - auth-regress:
623 context: gsqlite3-nodnssec-both
624 - auth-regress:
625 context: gsqlite3-both
626 - auth-regress:
627 context: gsqlite3-nsec3-both
628 - auth-regress:
629 context: gsqlite3-nsec3-optout-both
630 - auth-regress:
631 context: gsqlite3-nsec3-narrow
632
633 test-auth-regress-bind:
634 docker:
635 - image: debian:buster
636 - image: circleci/mysql:5 # for the hybrid test
637 steps:
638 - auth-regress-setup
639 - run:
640 command: apt-get install -qq -y sqlite3
641 - auth-regress:
642 context: bind-both
643 - auth-regress:
644 context: bind-dnssec-both
645 - auth-regress:
646 context: bind-dnssec-nsec3-both
647 - auth-regress:
648 context: bind-dnssec-nsec3-optout-both
649 - auth-regress:
650 context: bind-dnssec-nsec3-narrow
651 - run:
652 command: apt-get install -qq -y default-mysql-client
653 - run:
654 command: |
655 cat >> ~/.my.cnf \<<- __EOF__
656 [client]
657 protocol=TCP
658 __EOF__
659 - run:
660 name: Set up mysql client lib to force TCP
661 command: echo 'export GMYSQLHOST=127.0.0.1 MYDNSHOST=127.0.0.1' > ./vars
662 workdir: ~/project/regression-tests
663 - auth-regress:
664 context: bind-hybrid-nsec3
665
666 test-auth-regress-mydns:
667 docker:
668 - image: debian:buster
669 - image: circleci/mysql:5
670 steps:
671 - auth-regress-setup
672 - run:
673 command: apt-get install -qq -y default-mysql-client
674 - run:
675 command: |
676 cat >> ~/.my.cnf \<<- __EOF__
677 [client]
678 protocol=TCP
679 __EOF__
680 - run:
681 name: Set up mysql client lib to force TCP
682 command: echo 'export GMYSQLHOST=127.0.0.1 MYDNSHOST=127.0.0.1' > ./vars
683 workdir: ~/project/regression-tests
684 - auth-regress:
685 context: mydns
686 doroot: false
687
688 test-auth-regress-gmysql:
689 docker:
690 - image: debian:buster
691 - image: circleci/mysql:5
692 steps:
693 - auth-regress-setup
694 - run:
695 command: apt-get install -qq -y default-mysql-client
696 - run:
697 command: |
698 cat >> ~/.my.cnf \<<- __EOF__
699 [client]
700 protocol=TCP
701 default-character-set=latin1
702 __EOF__
703 - run:
704 name: Set up mysql client lib to force TCP
705 command: echo 'export GMYSQLHOST=127.0.0.1 MYDNSHOST=127.0.0.1 export GMYSQL2HOST=127.0.0.1 MYDNS2HOST=127.0.0.1 ' > ./vars
706 workdir: ~/project/regression-tests
707 - auth-regress:
708 context: gmysql-nodnssec-both
709 - auth-regress:
710 context: gmysql-both
711 - auth-regress:
712 context: gmysql-nsec3-both
713 - auth-regress:
714 context: gmysql-nsec3-optout-both
715 - auth-regress:
716 context: gmysql-nsec3-narrow
717
718 test-auth-regress-gpgsql:
719 docker:
720 - image: debian:buster
721 - image: circleci/postgres:9
722 environment:
723 POSTGRES_USER: root
724 steps:
725 - auth-regress-setup
726 - run:
727 command: apt-get install -qq -y postgresql-client
728 - run:
729 name: Use TCP for Postgresql connections
730 command: |
731 cat >> ./vars \<<- __EOF__
732 export PGHOST=127.0.0.1
733 export PGPORT=5432
734 __EOF__
735 workdir: ~/project/regression-tests
736 - auth-regress:
737 context: gpgsql-nodnssec-both
738 - auth-regress:
739 context: gpgsql-both
740 - auth-regress:
741 context: gpgsql-nsec3-both
742 - auth-regress:
743 context: gpgsql-nsec3-optout-both
744 - auth-regress:
745 context: gpgsql-nsec3-narrow
746
747 test-auth-regress-ldap:
748 docker:
749 - image: debian:buster
750 environment:
751 LDAPHOST: ldap://ldapserver/
752 - image: powerdns/ldap-regress:1.2.4-0 # OpenLDAP 2.4.47
753 name: ldapserver
754 command: '--loglevel debug'
755 environment:
756 LDAP_LOG_LEVEL: 0
757 steps:
758 - auth-regress-setup
759 - run: DEBIAN_FRONTEND=noninteractive apt-get install -qq -y ldap-utils
760 - auth-regress:
761 context: ldap-tree
762 doroot: false
763 - auth-regress:
764 context: ldap-simple
765 doroot: false
766 - auth-regress:
767 context: ldap-strict
768 doroot: false
769
770 test-auth-regress-tinydns:
771 docker:
772 - image: debian:buster
773 steps:
774 - auth-regress-setup
775 - auth-regress:
776 context: tinydns
777 doroot: false
778
779 test-auth-regress-lmdb:
780 docker:
781 - image: debian:buster
782 steps:
783 - auth-regress-setup
784 - run: apt-get install -y -qq jq curl
785 - auth-regress:
786 context: lmdb-nodnssec-both
787 - auth-regress:
788 context: lmdb-both
789 - auth-regress:
790 context: lmdb-nsec3-both
791 - auth-regress:
792 context: lmdb-nsec3-optout-both
793 - auth-regress:
794 context: lmdb-nsec3-narrow
795
796 test-auth-algorithms:
797 docker:
798 - image: debian:buster
799 steps:
800 - auth-regress-setup
801 - run:
802 name: Test all algorithms
803 command: /opt/pdns-auth/bin/pdnsutil test-algorithms
804
805 test-auth-api:
806 docker:
807 - image: debian:buster
808 steps:
809 - auth-regress-setup
810 - run: apt-get -y -qq install virtualenv sqlite3
811 - run:
812 name: Run API tests
813 workdir: ~/project/regression-tests.api
814 command: |
815 PDNSSERVER="/opt/pdns-auth/sbin/pdns_server" \
816 PDNSUTIL="/opt/pdns-auth/bin/pdnsutil" \
817 SDIG="/opt/pdns-auth/bin/sdig" \
818 ZONE2SQL="/opt/pdns-auth/bin/zone2sql" \
819 ./runtests authoritative
820
821 build-recursor:
822 docker:
823 - image: debian:buster
824 steps:
825 - restore-cache-ccache:
826 product: recursor
827 - run:
828 name: Install dependencies
829 command: |
830 apt-get update && apt-get -qq --no-install-recommends install \
831 autoconf \
832 automake \
833 ca-certificates \
834 curl \
835 bison \
836 flex \
837 g++ \
838 git \
839 libboost-all-dev \
840 libcap-dev \
841 libluajit-5.1-dev \
842 libfstrm-dev \
843 libprotobuf-dev \
844 libsodium-dev \
845 libssl-dev \
846 libsystemd-dev \
847 libtool \
848 make \
849 pkg-config \
850 protobuf-compiler \
851 ragel \
852 systemd \
853 virtualenv
854 - get-workspace
855 - run:
856 name: autoconf
857 command: BUILDER_VERSION=0.0.0-git1 autoreconf -vfi
858 working_directory: ~/project/pdns/recursordist
859 - run:
860 name: configure
861 command: |
862 CFLAGS="-O1 -Werror=vla -Wformat=2 -Werror=format-security" \
863 CXXFLAGS="-O1 -Werror=vla -Wformat=2 -Werror=format-security -Wp,-D_GLIBCXX_ASSERTIONS" \
864 ./configure \
865 --enable-unit-tests \
866 --enable-nod \
867 --enable-systemd \
868 --prefix=/opt/pdns-recursor \
869 --with-libsodium \
870 --with-lua=luajit \
871 --with-libcap \
872 --with-protobuf=yes \
873 --without-net-snmp
874 working_directory: ~/project/pdns/recursordist
875 - run:
876 name: build
877 command: make -j3 -k
878 working_directory: ~/project/pdns/recursordist
879 - save-ccache-cache:
880 product: recursor
881 - run:
882 name: Run unit tests
883 command: make check || (cat test-suite.log; false)
884 working_directory: ~/project/pdns/recursordist
885 - run:
886 name: Install resulting binaries
887 command: make install
888 working_directory: ~/project/pdns/recursordist
889 - persist_to_workspace:
890 root: /opt
891 paths:
892 - pdns-recursor
893
894 test-recursor-regression:
895 docker:
896 - image: debian:buster
897 steps:
898 - add-auth-repo
899 - 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
900 - install-recursor-deps
901 - run:
902 name: Set up authbind
903 command: |
904 touch /etc/authbind/byport/53
905 chmod 755 /etc/authbind/byport/53
906 - get-workspace
907 - run:
908 name: Run regression tests
909 workdir: ~/project
910 command: |
911 PDNSRECURSOR=/opt/pdns-recursor/sbin/pdns_recursor \
912 RECCONTROL=/opt/pdns-recursor/bin/rec_control \
913 ./build-scripts/test-recursor
914
915 test-recursor-bulk:
916 docker:
917 - image: debian:buster
918 steps:
919 - add-auth-repo
920 - run: apt-get --no-install-recommends install -qq -y pdns-tools moreutils time
921 - install-recursor-deps
922 - get-workspace
923 - run:
924 name: Get the majestic million list
925 workdir: ~/project/regression-tests
926 command: |
927 apt-get install -qq -y unzip && \
928 curl -LO http://s3-us-west-1.amazonaws.com/umbrella-static/top-1m.csv.zip && \
929 unzip top-1m.csv.zip -d .
930 - run:
931 name: Run bulktests
932 command: |
933 DNSBULKTEST=/usr/bin/dnsbulktest \
934 RECURSOR=/opt/pdns-recursor/sbin/pdns_recursor \
935 THRESHOLD=95 \
936 TRACE=no \
937 ./timestamp ./recursor-test 5300 50000 || \
938 (cat recursor.log; false)
939 workdir: ~/project/regression-tests
940
941 test-recursor-api:
942 docker:
943 - image: debian:buster
944 steps:
945 - add-auth-repo
946 - run: apt-get --no-install-recommends install -qq -y virtualenv pdns-tools
947 - install-recursor-deps
948 - get-workspace
949 - run:
950 name: Run API tests
951 workdir: ~/project/regression-tests.api
952 command: |
953 PDNSRECURSOR="/opt/pdns-recursor/sbin/pdns_recursor" \
954 ./runtests recursor
955
956 build-auth-docs:
957 docker:
958 - image: debian:buster
959 steps:
960 - get-workspace
961 - install-doc-deps
962 - build-auth-docs
963
964 deploy-auth-docs:
965 docker:
966 - image: debian:buster
967 steps:
968 - get-workspace
969 - install-doc-deps
970 - build-auth-docs
971 - add-docs-upload-ssh
972 - upload-auth-docs
973
974 build-recursor-docs:
975 docker:
976 - image: debian:buster
977 steps:
978 - get-workspace
979 - install-doc-deps
980 - build-recursor-docs
981
982 deploy-recursor-docs:
983 docker:
984 - image: debian:buster
985 steps:
986 - get-workspace
987 - install-doc-deps
988 - build-recursor-docs
989 - add-docs-upload-ssh
990 - upload-recursor-docs
991
992 build-dnsdist-docs:
993 docker:
994 - image: debian:buster
995 steps:
996 - get-workspace
997 - install-doc-deps
998 - build-dnsdist-docs
999
1000 deploy-dnsdist-docs:
1001 docker:
1002 - image: debian:buster
1003 steps:
1004 - get-workspace
1005 - install-doc-deps
1006 - build-dnsdist-docs
1007 - add-docs-upload-ssh
1008 - upload-dnsdist-docs
1009
1010 coverity-auth:
1011 docker:
1012 - image: debian:buster
1013 steps:
1014 - install-auth-dev-deps
1015 - install-coverity-tools
1016 - checkout-shallow
1017 - run:
1018 name: autoconf
1019 working_directory: /opt/project/
1020 command: BUILDER_VERSION=0.0.0-git1 autoreconf -vfi
1021 - run:
1022 name: configure
1023 working_directory: /opt/project/
1024 command: |
1025 CFLAGS="-O1 -Werror=vla -Wformat=2 -Werror=format-security" \
1026 CXXFLAGS="-O1 -Werror=vla -Wformat=2 -Werror=format-security -Wp,-D_GLIBCXX_ASSERTIONS" \
1027 ./configure \
1028 --disable-lua-records \
1029 --disable-systemd \
1030 --with-modules='bind lmdb ldap gmysql gsqlite3 gpgsql godbc mydns random tinydns' \
1031 --enable-tools \
1032 --with-lmdb=/usr \
1033 --with-libsodium \
1034 --prefix=/opt/pdns-auth
1035 - run:
1036 name: build
1037 working_directory: /opt/project/
1038 command: /usr/local/bin/cov-build --dir cov-int make -j2 -k
1039 - run:
1040 name: Create Coverity tarball
1041 working_directory: /opt/project/
1042 command: tar caf auth.tar.bz2 cov-int
1043 - run:
1044 name: Upload tarball to coverity
1045 working_directory: /opt/project/
1046 command: |
1047 curl --form token=${COVERITY_TOKEN} \
1048 --form email="${COVERITY_EMAIL}" \
1049 --form file=@auth.tar.bz2 \
1050 --form version="$(./builder-support/gen-version)" \
1051 --form description="master build" \
1052 https://scan.coverity.com/builds?project=${COVERITY_PROJECT}
1053
1054 coverity-dnsdist:
1055 docker:
1056 - image: debian:buster
1057 steps:
1058 - run:
1059 name: Install dependencies
1060 command: |
1061 apt-get update && apt-get -qq --no-install-recommends install \
1062 autoconf \
1063 automake \
1064 bison \
1065 bzip2 \
1066 ca-certificates \
1067 curl \
1068 flex \
1069 g++ \
1070 git \
1071 libboost-all-dev \
1072 libcap-dev \
1073 libcdb-dev \
1074 libedit-dev \
1075 libfstrm-dev \
1076 liblmdb-dev \
1077 libluajit-5.1-dev \
1078 libprotobuf-dev \
1079 libre2-dev \
1080 libsnmp-dev \
1081 libsodium-dev \
1082 libssl-dev \
1083 libsystemd-dev \
1084 libtool \
1085 make \
1086 pkg-config \
1087 protobuf-compiler \
1088 ragel \
1089 virtualenv
1090 - install-coverity-tools
1091 - checkout-shallow
1092 - run:
1093 name: autoconf
1094 command: BUILDER_VERSION=0.0.0-git1 autoreconf -vfi
1095 working_directory: /opt/project/pdns/dnsdistdist
1096 - run:
1097 name: configure
1098 command: |
1099 CFLAGS="-O1 -Werror=vla -Wformat=2 -Werror=format-security" \
1100 CXXFLAGS="-O1 -Werror=vla -Wformat=2 -Werror=format-security -Wp,-D_GLIBCXX_ASSERTIONS" \
1101 ./configure \
1102 --disable-systemd \
1103 --disable-unit-tests \
1104 --enable-dnstap \
1105 --enable-dnscrypt \
1106 --enable-dns-over-tls \
1107 --prefix=/opt/dnsdist \
1108 --with-libsodium \
1109 --with-lua=luajit \
1110 --with-libcap \
1111 --with-protobuf=yes \
1112 --with-re2
1113 working_directory: /opt/project/pdns/dnsdistdist
1114 - run:
1115 name: build
1116 command: /usr/local/bin/cov-build --dir cov-int make -j2 -k
1117 working_directory: /opt/project/pdns/dnsdistdist
1118 - run:
1119 name: Create Coverity tarball
1120 command: tar caf dnsdist.tar.bz2 cov-int
1121 working_directory: /opt/project/pdns/dnsdistdist
1122 - run:
1123 name: Upload tarball to coverity
1124 command: |
1125 curl --form token=${COVERITY_TOKEN} \
1126 --form email="${COVERITY_EMAIL}" \
1127 --form file=@pdns/dnsdistdist/dnsdist.tar.bz2 \
1128 --form version="$(./builder-support/gen-version)" \
1129 --form description="master build" \
1130 https://scan.coverity.com/builds?project=${COVERITY_PROJECT}
1131
1132 coverity-recursor:
1133 docker:
1134 - image: debian:buster
1135 steps:
1136 - run:
1137 name: Install dependencies
1138 command: |
1139 apt-get update && apt-get -qq --no-install-recommends install \
1140 autoconf \
1141 automake \
1142 ca-certificates \
1143 curl \
1144 bison \
1145 bzip2 \
1146 flex \
1147 g++ \
1148 git \
1149 libboost-all-dev \
1150 libcap-dev \
1151 libluajit-5.1-dev \
1152 libfstrm-dev \
1153 libprotobuf-dev \
1154 libsodium-dev \
1155 libssl-dev \
1156 libsystemd-dev \
1157 libtool \
1158 make \
1159 pkg-config \
1160 protobuf-compiler \
1161 ragel \
1162 virtualenv
1163 - install-coverity-tools
1164 - checkout-shallow
1165 - run:
1166 name: autoconf
1167 command: BUILDER_VERSION=0.0.0-git1 autoreconf -vfi
1168 working_directory: /opt/project/pdns/recursordist
1169 - run:
1170 name: configure
1171 command: |
1172 CFLAGS="-O1 -Werror=vla -Wformat=2 -Werror=format-security" \
1173 CXXFLAGS="-O1 -Werror=vla -Wformat=2 -Werror=format-security -Wp,-D_GLIBCXX_ASSERTIONS" \
1174 ./configure \
1175 --disable-systemd \
1176 --disable-unit-tests \
1177 --prefix=/opt/pdns-recursor \
1178 --with-libsodium \
1179 --with-lua=luajit \
1180 --with-libcap \
1181 --with-protobuf=yes \
1182 --without-net-snmp
1183 working_directory: /opt/project/pdns/recursordist
1184 - run:
1185 name: build
1186 command: /usr/local/bin/cov-build --dir cov-int make -j2 -k
1187 working_directory: /opt/project/pdns/recursordist
1188 - run:
1189 name: Create Coverity tarball
1190 command: tar caf recursor.tar.bz2 cov-int
1191 working_directory: /opt/project/pdns/recursordist
1192 - run:
1193 name: Upload tarball to coverity
1194 command: |
1195 curl --form token=${COVERITY_TOKEN} \
1196 --form email="${COVERITY_EMAIL}" \
1197 --form file=@pdns/recursordist/recursor.tar.bz2 \
1198 --form version="$(./builder-support/gen-version)" \
1199 --form description="master build" \
1200 https://scan.coverity.com/builds?project=${COVERITY_PROJECT}
1201
1202 build-dnsdist:
1203 docker:
1204 - image: debian:buster
1205 environment:
1206 UBSAN_OPTIONS: 'print_stacktrace=1:halt_on_error=1'
1207 steps:
1208 - restore-cache-ccache:
1209 product: dnsdist
1210 - run:
1211 name: Install dependencies
1212 command: |
1213 apt-get update && apt-get -qq --no-install-recommends install \
1214 autoconf \
1215 automake \
1216 g++ \
1217 git \
1218 libboost-all-dev \
1219 libcap-dev \
1220 libcdb-dev \
1221 libedit-dev \
1222 libfstrm-dev \
1223 libh2o-evloop-dev \
1224 liblmdb-dev \
1225 libluajit-5.1-dev \
1226 libprotobuf-dev \
1227 libre2-dev \
1228 libsnmp-dev \
1229 libsodium-dev \
1230 libssl-dev \
1231 libsystemd-dev \
1232 libtool \
1233 make \
1234 pkg-config \
1235 protobuf-compiler \
1236 ragel \
1237 systemd \
1238 virtualenv
1239 - get-workspace
1240 - run:
1241 name: autoconf
1242 command: BUILDER_VERSION=0.0.0-git1 autoreconf -vfi
1243 working_directory: ~/project/pdns/dnsdistdist
1244 - run:
1245 name: configure
1246 command: |
1247 CFLAGS="-O1 -Werror=vla -Wformat=2 -Werror=format-security" \
1248 CXXFLAGS="-O1 -Werror=vla -Wformat=2 -Werror=format-security -Wp,-D_GLIBCXX_ASSERTIONS" \
1249 ./configure \
1250 --enable-unit-tests \
1251 --enable-dnstap \
1252 --enable-dnscrypt \
1253 --enable-dns-over-tls \
1254 --enable-dns-over-https \
1255 --enable-systemd \
1256 --prefix=/opt/dnsdist \
1257 --with-libsodium \
1258 --with-lua=luajit \
1259 --with-libcap \
1260 --with-protobuf=yes \
1261 --with-re2 \
1262 --enable-asan \
1263 --enable-ubsan
1264 working_directory: ~/project/pdns/dnsdistdist
1265 - run:
1266 name: build
1267 command: make -j1 -k
1268 working_directory: ~/project/pdns/dnsdistdist
1269 - save-ccache-cache:
1270 product: dnsdist
1271 - run:
1272 name: Run unit tests
1273 command: make check || (cat test-suite.log; false)
1274 working_directory: ~/project/pdns/dnsdistdist
1275 - run:
1276 name: Install resulting binaries
1277 command: make install
1278 working_directory: ~/project/pdns/dnsdistdist
1279 - persist_to_workspace:
1280 root: /opt
1281 paths:
1282 - dnsdist
1283
1284 test-dnsdist-regression:
1285 docker:
1286 - image: debian:buster
1287 environment:
1288 UBSAN_OPTIONS: 'print_stacktrace=1:halt_on_error=1'
1289 steps:
1290 - install-dnsdist-deps
1291 - get-workspace
1292 - run:
1293 name: setup snmp
1294 command: |
1295 apt-get -qq --no-install-recommends install snmpd
1296 sed "s/agentxperms 0700 0755 dnsdist/agentxperms 0700 0755/g" regression-tests.dnsdist/snmpd.conf > /etc/snmp/snmpd.conf
1297 /etc/init.d/snmpd start
1298 - run:
1299 name: Run dnsdist tests
1300 workdir: ~/project/regression-tests.dnsdist
1301 command: |
1302 DNSDISTBIN="/opt/dnsdist/bin/dnsdist" \
1303 ./runtests
1304
1305 test-ixfrdist-regression:
1306 docker:
1307 - image: debian:buster
1308 environment:
1309 UBSAN_OPTIONS: 'print_stacktrace=1:halt_on_error=1'
1310 steps:
1311 - install-ixfrdist-deps
1312 - get-workspace
1313 - run:
1314 name: Run ixfrdist tests
1315 workdir: ~/project/regression-tests.ixfrdist
1316 command: |
1317 IXFRDISTBIN="/opt/pdns-auth/bin/ixfrdist" \
1318 ./runtests
1319
1320 workflows:
1321 version: 2
1322 coverity:
1323 triggers:
1324 - schedule:
1325 cron: "0 0 * * *"
1326 filters:
1327 branches:
1328 only: master
1329 jobs:
1330 - coverity-auth:
1331 context: auth-coverity
1332 - coverity-dnsdist:
1333 context: dnsdist-coverity
1334 - coverity-recursor:
1335 context: recursor-coverity
1336
1337 build-and-test-all:
1338 jobs:
1339 - checkout
1340 - build-auth:
1341 requires:
1342 - checkout
1343 - test-auth-api:
1344 requires:
1345 - build-auth
1346 - test-auth-algorithms:
1347 requires:
1348 - build-auth
1349 - test-auth-regress-odbc-sqlite3:
1350 requires:
1351 - build-auth
1352 - test-auth-regress-odbc-mssql:
1353 requires:
1354 - build-auth
1355 - test-auth-regress-gmysql:
1356 requires:
1357 - build-auth
1358 - test-auth-regress-mydns:
1359 requires:
1360 - build-auth
1361 - test-auth-regress-bind:
1362 requires:
1363 - build-auth
1364 - test-auth-regress-gsqlite3:
1365 requires:
1366 - build-auth
1367 - test-auth-regress-gpgsql:
1368 requires:
1369 - build-auth
1370 - test-auth-regress-lmdb:
1371 requires:
1372 - build-auth
1373 - test-auth-regress-ldap:
1374 requires:
1375 - build-auth
1376 - test-auth-regress-tinydns:
1377 requires:
1378 - build-auth
1379 - build-recursor:
1380 requires:
1381 - checkout
1382 - test-recursor-regression:
1383 requires:
1384 - build-recursor
1385 - test-recursor-bulk:
1386 requires:
1387 - build-recursor
1388 - test-recursor-api:
1389 requires:
1390 - build-recursor
1391 - build-dnsdist:
1392 requires:
1393 - checkout
1394 - test-dnsdist-regression:
1395 requires:
1396 - build-dnsdist
1397 - test-ixfrdist-regression:
1398 requires:
1399 - build-auth
1400
1401 build-docs:
1402 jobs:
1403 - checkout
1404 - build-auth-docs:
1405 filters:
1406 branches:
1407 ignore: master
1408 requires:
1409 - checkout
1410 - build-recursor-docs:
1411 filters:
1412 branches:
1413 ignore: master
1414 requires:
1415 - checkout
1416 - build-dnsdist-docs:
1417 filters:
1418 branches:
1419 ignore: master
1420 requires:
1421 - checkout
1422
1423 # These actually deploy
1424 - deploy-auth-docs:
1425 context: docs
1426 filters:
1427 branches:
1428 only: master
1429 requires:
1430 - checkout
1431 - deploy-recursor-docs:
1432 context: docs
1433 filters:
1434 branches:
1435 only: master
1436 requires:
1437 - checkout
1438 - deploy-dnsdist-docs:
1439 context: docs
1440 filters:
1441 branches:
1442 only: master
1443 requires:
1444 - checkout