paths:
- dnsdist
- build-dnsdist-with-tsan:
- docker:
- - image: debian:buster
- auth:
- username: powerdnsreadonly
- password: $DOCKERHUB_PASSWORD
- environment:
- TSAN_OPTIONS: 'halt_on_error=1:suppressions=/opt/project/pdns/dnsdistdist/dnsdist-tsan.supp'
- steps:
- - run:
- name: Install dependencies
- command: |
- apt-get update && apt-get -qq --no-install-recommends install \
- autoconf \
- automake \
- g++ \
- git \
- libboost-all-dev \
- libcap-dev \
- libcdb-dev \
- libedit-dev \
- libfstrm-dev \
- libgnutls28-dev \
- libh2o-evloop-dev \
- liblmdb-dev \
- libluajit-5.1-dev \
- libre2-dev \
- libsnmp-dev \
- libsodium-dev \
- libssl-dev \
- libsystemd-dev \
- libtool \
- make \
- pkg-config \
- ragel \
- systemd \
- python3-venv
- - install-clang-8
- - restore-cache-ccache:
- product: dnsdist-with-tsan
- - get-workspace
- - run:
- name: autoconf
- command: BUILDER_VERSION=0.0.0-git1 autoreconf -vfi
- working_directory: ~/project/pdns/dnsdistdist
- - run:
- name: configure
- command: |
- CC='clang-8' \
- CXX='clang++-8' \
- CFLAGS="-O1 -Werror=vla -Werror=shadow -Wformat=2 -Werror=format-security -Werror=string-plus-int" \
- CXXFLAGS="-O1 -Werror=vla -Werror=shadow -Wformat=2 -Werror=format-security -Werror=string-plus-int -Wp,-D_GLIBCXX_ASSERTIONS" \
- ./configure \
- --enable-option-checking=fatal \
- --enable-unit-tests \
- --enable-dnstap \
- --enable-dnscrypt \
- --enable-dns-over-tls \
- --enable-dns-over-https \
- --enable-systemd \
- --prefix=/opt/dnsdist-with-tsan \
- --with-gnutls \
- --with-libsodium \
- --with-lua=luajit \
- --with-libcap \
- --with-re2 \
- --enable-tsan
- working_directory: ~/project/pdns/dnsdistdist
- - run:
- name: build
- command: make -j1 -k
- working_directory: ~/project/pdns/dnsdistdist
- - save-ccache-cache:
- product: dnsdist-with-tsan
- - run:
- name: Run unit tests
- command: make check || (cat test-suite.log; false)
- working_directory: ~/project/pdns/dnsdistdist
- - run:
- name: Install resulting binaries
- command: make install
- working_directory: ~/project/pdns/dnsdistdist
- - persist_to_workspace:
- root: /opt
- paths:
- - dnsdist-with-tsan
-
- test-dnsdist-regression-with-tsan:
- resource_class: small
-
- docker:
- - image: debian:buster
- auth:
- username: powerdnsreadonly
- password: $DOCKERHUB_PASSWORD
- environment:
- TSAN_OPTIONS: 'halt_on_error=1:suppressions=/opt/project/pdns/dnsdistdist/dnsdist-tsan.supp'
- steps:
- - install-dnsdist-deps
- - install-clang-8 # for the symbolizer
- - get-workspace
- - run:
- name: setup snmp
- command: |
- apt-get -qq --no-install-recommends install snmpd
- sed "s/agentxperms 0700 0755 dnsdist/agentxperms 0700 0755/g" regression-tests.dnsdist/snmpd.conf > /etc/snmp/snmpd.conf
- /etc/init.d/snmpd start
- - run:
- name: install prometheus tools
- command: |
- apt-get -qq --no-install-recommends install prometheus
- - run:
- name: Run dnsdist tests
- workdir: ~/project/regression-tests.dnsdist
- command: |
- DNSDISTBIN="/opt/dnsdist-with-tsan/bin/dnsdist" \
- ./runtests
-
test-ixfrdist-regression:
resource_class: small
- test-recursor-bulk:
requires:
- build-recursor
- - build-dnsdist:
- requires:
- - checkout
- - build-dnsdist-with-tsan:
- requires:
- - checkout
- - test-dnsdist-regression-with-tsan:
- requires:
- - build-dnsdist-with-tsan
- test-ixfrdist-regression:
requires:
- build-auth
build-dnsdist:
name: build dnsdist
runs-on: ubuntu-20.04
+ strategy:
+ matrix:
+ sanitizers: [ubsan+asan, tsan]
env:
UBSAN_OPTIONS: 'print_stacktrace=1:halt_on_error=1:suppressions=/home/runner/work/pdns/pdns/build-scripts/UBSan.supp'
ASAN_OPTIONS: detect_leaks=0
+ SANITIZERS: ${{ matrix.sanitizers }}
defaults:
run:
working-directory: ./pdns/dnsdistdist/
- name: Store the binaries
uses: actions/upload-artifact@v2 # this takes 30 seconds, maybe we want to tar
with:
- name: dnsdist
+ name: dnsdist-${{ matrix.sanitizers }}
path: /opt/dnsdist
test-auth-api:
env:
UBSAN_OPTIONS: 'print_stacktrace=1:halt_on_error=1:suppressions=/home/runner/work/pdns/pdns/build-scripts/UBSan.supp'
ASAN_OPTIONS: detect_leaks=0
+ TSAN_OPTIONS: 'halt_on_error=1:suppressions=/home/runner/work/pdns/pdns/pdns/dnsdistdist/dnsdist-tsan.supp'
strategy:
matrix:
include:
test-dnsdist-regression:
needs: build-dnsdist
runs-on: ubuntu-20.04
+ strategy:
+ matrix:
+ sanitizers: [ubsan+asan, tsan]
env:
UBSAN_OPTIONS: 'print_stacktrace=1:halt_on_error=1:suppressions=/home/runner/work/pdns/pdns/build-scripts/UBSan.supp'
ASAN_OPTIONS: detect_leaks=0
+ TSAN_OPTIONS: 'halt_on_error=1:suppressions=/home/runner/work/pdns/pdns/pdns/dnsdistdist/dnsdist-tsan.supp'
steps:
- uses: actions/checkout@v2.3.4
with:
- name: Fetch the binaries
uses: actions/download-artifact@v2
with:
- name: dnsdist
+ name: dnsdist-${{ matrix.sanitizers }}
path: /opt/dnsdist
- run: build-scripts/gh-actions-setup-inv # this runs apt update+upgrade
- run: inv install-clang-runtime
from invoke import task
from invoke.exceptions import Failure, UnexpectedExit
+import os
import sys
import time
@task
def ci_dnsdist_configure(c):
+ sanitizers = ' '.join('--enable-'+x for x in os.getenv('SANITIZERS').split('+'))
res = c.run('''CFLAGS="-O1 -Werror=vla -Werror=shadow -Wformat=2 -Werror=format-security -Werror=string-plus-int" \
CXXFLAGS="-O1 -Werror=vla -Werror=shadow -Wformat=2 -Werror=format-security -Werror=string-plus-int -Wp,-D_GLIBCXX_ASSERTIONS" \
./configure \
--with-libsodium \
--with-lua=luajit \
--with-libcap \
- --with-re2 \
- --enable-asan \
- --enable-ubsan''', warn=True)
+ --with-re2 ''' + sanitizers, warn=True)
if res.exited != 0:
c.run('cat config.log')
raise UnexpectedExit(res)