From: Otto Date: Tue, 2 Nov 2021 08:17:47 +0000 (+0100) Subject: Initial stab at running the recursor regress and bulk tests on GH workflows X-Git-Tag: rec-4.6.0-beta1~1^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6b45d67bf9b01f931dece349fe451a3e54fe5f77;p=thirdparty%2Fpdns.git Initial stab at running the recursor regress and bulk tests on GH workflows Some issues had to be worked around: libfaketime and bulk test network load --- diff --git a/.github/workflows/build-and-test-all.yml b/.github/workflows/build-and-test-all.yml index 2d6db51e01..ceaa558cfe 100644 --- a/.github/workflows/build-and-test-all.yml +++ b/.github/workflows/build-and-test-all.yml @@ -290,6 +290,49 @@ jobs: - run: inv install-rec-test-deps - run: inv test-api recursor + test-recursor-regression: + needs: build-recursor + runs-on: ubuntu-20.04 + 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 + steps: + - uses: actions/checkout@v2.3.4 + with: + fetch-depth: 5 + submodules: recursive + - name: Fetch the binaries + uses: actions/download-artifact@v2 + with: + name: pdns-recursor + path: /opt/pdns-recursor + - run: build-scripts/gh-actions-setup-inv # this runs apt update+upgrade + - run: inv add-auth-repo + - run: inv install-clang-runtime + - run: inv install-rec-test-deps + - run: inv test-regression-recursor + + test-recursor-bulk: + needs: build-recursor + runs-on: ubuntu-20.04 + 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 + steps: + - uses: actions/checkout@v2.3.4 + with: + fetch-depth: 5 + submodules: recursive + - name: Fetch the binaries + uses: actions/download-artifact@v2 + with: + name: pdns-recursor + path: /opt/pdns-recursor + - run: build-scripts/gh-actions-setup-inv # this runs apt update+upgrade + - run: inv install-clang-runtime + - run: inv install-rec-test-deps + - run: inv test-bulk-recursor + test-dnsdist-regression: needs: build-dnsdist runs-on: ubuntu-20.04 diff --git a/build-scripts/test-recursor b/build-scripts/test-recursor index 1107e499d0..ac41da9da3 100755 --- a/build-scripts/test-recursor +++ b/build-scripts/test-recursor @@ -59,7 +59,7 @@ sleep 3 ./clean.sh cd ../regression-tests.recursor-dnssec -./runtests || EXIT=1 +./runtests $@ || EXIT=1 ./printlogs.py || true exit $EXIT diff --git a/regression-tests.recursor-dnssec/runtests b/regression-tests.recursor-dnssec/runtests index 08b0e5efad..df3a4fb3c1 100755 --- a/regression-tests.recursor-dnssec/runtests +++ b/regression-tests.recursor-dnssec/runtests @@ -55,6 +55,12 @@ if ! "$PDNSRECURSOR" --version 2>&1 | grep Features | grep -q dnstap-framestream export NODNSTAPTESTS=1 fi +# libfstrm has a bad interaction with libfaketime on at leas Ubuntu focal +# to run the test without LIBFAKETIME, we clear the var if it set to /bin/false +if [ "$LIBFAKETIME" = "/bin/false" ]; then + LIBFAKETIME="" +fi + if [ "${LIBAUTHBIND}" != "" -o "${LIBFAKETIME}" != "" ]; then LD_PRELOAD="${LIBASAN} ${LIBAUTHBIND} ${LIBFAKETIME}" nosetests -I test_WellKnown.py --with-xunit $@ else diff --git a/regression-tests/recursor-test b/regression-tests/recursor-test index 5b7d1a628d..4523fb9c5d 100755 --- a/regression-tests/recursor-test +++ b/regression-tests/recursor-test @@ -34,6 +34,7 @@ rm -f recursor.pid pdns_recursor.pid ' ${RECURSOR} --daemon=no --local-port=$port --socket-dir=./ --trace=$TRACE --config-dir=. --max-mthreads=$mthreads --query-local-address="0.0.0.0${QLA6}" --threads=$threads --record-cache-shards=$shards --disable-packetcache --refresh-on-ttl-perc=10 --dnssec=validate > recursor.log 2>&1 & sleep 3 if [ ! -e pdns_recursor.pid ]; then + cat recursor.log echo Recursor did not start or did not write pdns_recursor.pid, exiting exit 1 fi diff --git a/tasks.py b/tasks.py index 0f2671e130..11579813f8 100644 --- a/tasks.py +++ b/tasks.py @@ -158,19 +158,31 @@ def install_auth_test_deps(c, backend): # FIXME: rename this, we do way more tha @task def install_rec_test_deps(c): # FIXME: rename this, we do way more than apt-get - c.sudo('apt-get --no-install-recommends install -qq -y authbind python3-venv python3-dev default-libmysqlclient-dev libpq-dev pdns-tools libluajit-5.1-2 \ + c.sudo('apt-get --no-install-recommends install -qq -y \ + pdns-server curl unzip pdns-backend-bind pdns-tools daemontools \ + jq libfaketime lua-posix lua-socket moreutils bc authbind \ + python3-venv python3-dev default-libmysqlclient-dev libpq-dev \ + libluajit-5.1-2 \ libboost-all-dev \ libcap2 \ libssl1.1 \ libsystemd0 \ libsodium23 \ libfstrm0 \ - libsnmp35') + libsnmp35 \ + protobuf-compiler \ + snmpd \ + prometheus') c.run('chmod +x /opt/pdns-recursor/bin/* /opt/pdns-recursor/sbin/*') setup_authbind(c) + c.run('sed "s/agentxperms 0700 0755 recursor/agentxperms 0777 0755/g" regression-tests.recursor-dnssec/snmpd.conf | sudo tee /etc/snmp/snmpd.conf') + c.sudo('systemctl restart snmpd') + time.sleep(5) + c.sudo('chmod 755 /var/agentx') + @task def install_dnsdist_test_deps(c): # FIXME: rename this, we do way more than apt-get c.sudo('apt-get install -qq -y \ @@ -433,6 +445,21 @@ def test_dnsdist(c): with c.cd('regression-tests.dnsdist'): c.run('DNSDISTBIN=/opt/dnsdist/bin/dnsdist ./runtests') +@task +def test_regression_recursor(c): + c.run('/opt/pdns-recursor/sbin/pdns_recursor --version') + c.run('PDNSRECURSOR=/opt/pdns-recursor/sbin/pdns_recursor RECCONTROL=/opt/pdns-recursor/bin/rec_control SKIP_IPV6_TESTS=y LIBFAKETIME=/bin/false ./build-scripts/test-recursor test_RecDnstap.py') + c.run('PDNSRECURSOR=/opt/pdns-recursor/sbin/pdns_recursor RECCONTROL=/opt/pdns-recursor/bin/rec_control SKIP_IPV6_TESTS=y ./build-scripts/test-recursor') + +@task +def test_bulk_recursor(c): + # We run an extremely samll version of the bulk test, as GH does not seem to be able to handle the UDP load + with c.cd('regression-tests'): + c.run('curl -LO http://s3-us-west-1.amazonaws.com/umbrella-static/top-1m.csv.zip') + c.run('unzip top-1m.csv.zip -d .') + c.run('chmod +x /opt/pdns-recursor/bin/* /opt/pdns-recursor/sbin/*') + c.run('DNSBULKTEST=/usr/bin/dnsbulktest RECURSOR=/opt/pdns-recursor/sbin/pdns_recursor RECCONTROL=/opt/pdns-recursor/bin/rec_control THRESHOLD=95 TRACE=no ./timestamp ./recursor-test 5300 1000 2') + # this is run always def setup(): if '/usr/lib/ccache' not in os.environ['PATH']: