]> granicus.if.org Git - pdns/commitdiff
Add regression test for the auth statistics
authorPieter Lexis <pieter.lexis@powerdns.com>
Wed, 15 Jul 2015 12:21:31 +0000 (14:21 +0200)
committerPieter Lexis <pieter.lexis@powerdns.com>
Wed, 15 Jul 2015 19:58:46 +0000 (21:58 +0200)
regression-tests.nobackend/counters/command [new file with mode: 0755]
regression-tests.nobackend/counters/description [new file with mode: 0644]
regression-tests.nobackend/counters/expected_result [new file with mode: 0644]

diff --git a/regression-tests.nobackend/counters/command b/regression-tests.nobackend/counters/command
new file mode 100755 (executable)
index 0000000..9263f34
--- /dev/null
@@ -0,0 +1,31 @@
+#!/usr/bin/env bash
+set -e
+set -x
+
+port=5600
+
+rm -f pdns*.pid
+
+../pdns/pdns_server --daemon=no --local-ipv6=::1 --local-address=127.0.0.1 \
+  --local-port=$port --socket-dir=./ --no-shuffle --launch=random --no-config \
+  --module-dir=../regression-tests/modules &
+
+sleep 5
+
+../pdns/sdig 127.0.0.1 $port random.example.com A >&2
+../pdns/sdig 127.0.0.1 $port example.com SOA >&2
+
+../pdns/sdig 127.0.0.1 $port random.example.com A tcp >&2
+../pdns/sdig 127.0.0.1 $port example.com SOA tcp >&2
+
+../pdns/sdig ::1 $port random.example.com A >&2
+../pdns/sdig ::1 $port random.example.com A tcp >&2
+
+../pdns/sdig ::1 $port example.com SOA >&2
+../pdns/sdig ::1 $port example.com SOA tcp >&2
+
+../pdns/pdns_control --config-name= --no-config --socket-dir=./ 'show *' | \
+  tr ',' '\n'| grep -v -E '(user-msec|sys-msec|uptime|udp-noport-errors|udp-in-errors|udp-recvbuf-errors|udp-sndbuf-errors)' | LC_ALL=C sort
+
+kill $(cat pdns*.pid)
+rm pdns*.pid
diff --git a/regression-tests.nobackend/counters/description b/regression-tests.nobackend/counters/description
new file mode 100644 (file)
index 0000000..c3d7e75
--- /dev/null
@@ -0,0 +1,2 @@
+This starts the server, does some IPv4 and IPv6 queries and checks if the
+statistics emitted are correct.
diff --git a/regression-tests.nobackend/counters/expected_result b/regression-tests.nobackend/counters/expected_result
new file mode 100644 (file)
index 0000000..3cc88fb
--- /dev/null
@@ -0,0 +1,46 @@
+
+corrupt-packets=0
+deferred-cache-inserts=0
+deferred-cache-lookup=0
+dnsupdate-answers=0
+dnsupdate-changes=0
+dnsupdate-queries=0
+dnsupdate-refused=0
+incoming-notifications=0
+key-cache-size=0
+latency=0
+meta-cache-size=1
+packetcache-hit=4
+packetcache-miss=4
+packetcache-size=0
+qsize-q=0
+query-cache-hit=3
+query-cache-miss=9
+rd-queries=0
+recursing-answers=0
+recursing-questions=0
+recursion-unanswered=0
+security-status=0
+servfail-packets=0
+signature-cache-size=0
+signatures=0
+tcp-answers-bytes=264
+tcp-answers=4
+tcp-queries=4
+tcp4-answers-bytes=132
+tcp4-answers=2
+tcp4-queries=2
+tcp6-answers-bytes=132
+tcp6-answers=2
+tcp6-queries=2
+timedout-packets=0
+udp-answers-bytes=264
+udp-answers=4
+udp-do-queries=0
+udp-queries=3
+udp4-answers-bytes=132
+udp4-answers=2
+udp4-queries=2
+udp6-answers-bytes=132
+udp6-answers=2
+udp6-queries=2