]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Initial stab at running the recursor regress and bulk tests on GH workflows
authorOtto <otto.moerbeek@open-xchange.com>
Tue, 2 Nov 2021 08:17:47 +0000 (09:17 +0100)
committerOtto <otto.moerbeek@open-xchange.com>
Wed, 3 Nov 2021 09:14:25 +0000 (10:14 +0100)
Some issues had to be worked around: libfaketime and bulk test network load

.github/workflows/build-and-test-all.yml
build-scripts/test-recursor
regression-tests.recursor-dnssec/runtests
regression-tests/recursor-test
tasks.py

index 2d6db51e015a50609f20638c7b836ab59d15cb49..ceaa558cfe229cd735d2d3400b6af76c7b1c7b95 100644 (file)
@@ -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
index 1107e499d0eaa5e951441ceb410408031d0098c4..ac41da9da3f9fae84236aa782fead9c83bf05d13 100755 (executable)
@@ -59,7 +59,7 @@ sleep 3
 ./clean.sh
 
 cd ../regression-tests.recursor-dnssec
-./runtests || EXIT=1
+./runtests $@ || EXIT=1
 ./printlogs.py || true
 
 exit $EXIT
index 08b0e5efad80405bbc4623ff098bf89087258078..df3a4fb3c1025a981c8e2e875a5623b2ada0de9c 100755 (executable)
@@ -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
index 5b7d1a628da4b7adc52d9bf2d637bb8ae36e17d8..4523fb9c5dac3ba6595e03f6526d1b8ba1d70510 100755 (executable)
@@ -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
index 0f2671e1304f81b0e932c223f0e9e9e4ac32d08f..11579813f828c444c5ac1cedda5da979223bf270 100644 (file)
--- 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']: