From b7b48cac0152cba8f0e655226103b14839137ec3 Mon Sep 17 00:00:00 2001 From: Pieter Lexis Date: Wed, 15 Jul 2015 14:21:31 +0200 Subject: [PATCH] Add regression test for the auth statistics --- regression-tests.nobackend/counters/command | 31 +++++++++++++ .../counters/description | 2 + .../counters/expected_result | 46 +++++++++++++++++++ 3 files changed, 79 insertions(+) create mode 100755 regression-tests.nobackend/counters/command create mode 100644 regression-tests.nobackend/counters/description create mode 100644 regression-tests.nobackend/counters/expected_result diff --git a/regression-tests.nobackend/counters/command b/regression-tests.nobackend/counters/command new file mode 100755 index 000000000..9263f345f --- /dev/null +++ b/regression-tests.nobackend/counters/command @@ -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 index 000000000..c3d7e756c --- /dev/null +++ b/regression-tests.nobackend/counters/description @@ -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 index 000000000..3cc88fb42 --- /dev/null +++ b/regression-tests.nobackend/counters/expected_result @@ -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 -- 2.40.0