]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
auth: add default-publish-cds test 8594/head
authorPeter van Dijk <peter.van.dijk@powerdns.com>
Mon, 27 Jan 2020 12:00:03 +0000 (13:00 +0100)
committerPeter van Dijk <peter.van.dijk@powerdns.com>
Mon, 27 Jan 2020 16:06:41 +0000 (17:06 +0100)
regression-tests.nobackend/default-publish-cds/.gitignore [new file with mode: 0644]
regression-tests.nobackend/default-publish-cds/command [new file with mode: 0755]
regression-tests.nobackend/default-publish-cds/description [new file with mode: 0644]
regression-tests.nobackend/default-publish-cds/expected_result [new file with mode: 0644]
regression-tests.nobackend/default-publish-cds/named.conf [new file with mode: 0644]
regression-tests.nobackend/default-publish-cds/pdns.conf [new file with mode: 0644]

diff --git a/regression-tests.nobackend/default-publish-cds/.gitignore b/regression-tests.nobackend/default-publish-cds/.gitignore
new file mode 100644 (file)
index 0000000..fd2e270
--- /dev/null
@@ -0,0 +1 @@
+/bind-dnssec.db
diff --git a/regression-tests.nobackend/default-publish-cds/command b/regression-tests.nobackend/default-publish-cds/command
new file mode 100755 (executable)
index 0000000..48a855d
--- /dev/null
@@ -0,0 +1,46 @@
+#!/usr/bin/env bash
+set -e
+if [ "${PDNS_DEBUG}" = "YES" ]; then
+  set -x
+fi
+
+bindwait ()
+{
+       configname=$1
+       domcount=1
+       loopcount=0
+       while [ $loopcount -lt 20 ]; do
+               sleep 1
+               done=$( ($PDNSCONTROL --config-name=$configname --socket-dir=. --no-config bind-domain-status || true) | grep -c 'parsed into memory' || true )
+               if [ $done = $domcount ]
+                       then
+                       return
+               fi
+               let loopcount=loopcount+1
+       done
+       if [ $done != $domcount ]; then
+               echo "Domain parsing failed" >> failed_tests
+       fi
+}
+
+port=5503
+rm -f pdns*.pid
+
+rm -f default-publish-cds/bind-dnssec.db
+
+$PDNSUTIL --config-dir=default-publish-cds create-bind-db default-publish-cds/bind-dnssec.db
+$PDNSUTIL --config-dir default-publish-cds/ import-zone-key minimal.com ../regression-tests/secure-delegated.dnssec-parent.com.private
+
+$PDNS --config-dir=default-publish-cds &
+bindwait
+
+$SDIG 127.0.0.1 $port minimal.com CDS dnssec | LC_ALL=C sort
+$PDNSUTIL --config-dir=default-publish-cds set-publish-cds minimal.com 2
+$SDIG 127.0.0.1 $port minimal.com CDS dnssec | LC_ALL=C sort
+$PDNSUTIL --config-dir=default-publish-cds set-publish-cds minimal.com ''
+$SDIG 127.0.0.1 $port minimal.com CDS dnssec | LC_ALL=C sort
+$PDNSUTIL --config-dir=default-publish-cds unset-publish-cds minimal.com
+$SDIG 127.0.0.1 $port minimal.com CDS dnssec | LC_ALL=C sort
+
+kill $(cat pdns*.pid)
+rm pdns*.pid
diff --git a/regression-tests.nobackend/default-publish-cds/description b/regression-tests.nobackend/default-publish-cds/description
new file mode 100644 (file)
index 0000000..e945af1
--- /dev/null
@@ -0,0 +1 @@
+Test default-publish-cds setting, and overriding it from metadata.
\ No newline at end of file
diff --git a/regression-tests.nobackend/default-publish-cds/expected_result b/regression-tests.nobackend/default-publish-cds/expected_result
new file mode 100644 (file)
index 0000000..b191553
--- /dev/null
@@ -0,0 +1,23 @@
+1
+0      minimal.com.    IN      CDS     86400   54319 8 4 ff159f2cc251c9850b24bedb9158f33b292137d228a2a8686c2a178e29e1097f80210813beba035bb065bbe1ffbb2229
+0      minimal.com.    IN      RRSIG   86400   CDS 8 2 86400 [expiry] [inception] [keytag] minimal.com. ...
+2      .       IN      OPT     32768   
+Rcode: 0 (No Error), RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
+Reply to question for qname='minimal.com.', qtype=CDS
+0      minimal.com.    IN      CDS     86400   54319 8 2 c5359d2a312ff6c28883b5d6404c76666262c26bd3dadfed63afb366e6f09c24
+0      minimal.com.    IN      RRSIG   86400   CDS 8 2 86400 [expiry] [inception] [keytag] minimal.com. ...
+2      .       IN      OPT     32768   
+Rcode: 0 (No Error), RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
+Reply to question for qname='minimal.com.', qtype=CDS
+1      minimal.com.    IN      NSEC    86400   minimal.com. NS SOA RRSIG NSEC DNSKEY
+1      minimal.com.    IN      RRSIG   120     SOA 8 2 120 [expiry] [inception] [keytag] minimal.com. ...
+1      minimal.com.    IN      RRSIG   86400   NSEC 8 2 86400 [expiry] [inception] [keytag] minimal.com. ...
+1      minimal.com.    IN      SOA     120     ns1.example.com. ahu.example.com. 2000081501 28800 7200 604800 86400
+2      .       IN      OPT     32768   
+Rcode: 0 (No Error), RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
+Reply to question for qname='minimal.com.', qtype=CDS
+0      minimal.com.    IN      CDS     86400   54319 8 4 ff159f2cc251c9850b24bedb9158f33b292137d228a2a8686c2a178e29e1097f80210813beba035bb065bbe1ffbb2229
+0      minimal.com.    IN      RRSIG   86400   CDS 8 2 86400 [expiry] [inception] [keytag] minimal.com. ...
+2      .       IN      OPT     32768   
+Rcode: 0 (No Error), RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
+Reply to question for qname='minimal.com.', qtype=CDS
diff --git a/regression-tests.nobackend/default-publish-cds/named.conf b/regression-tests.nobackend/default-publish-cds/named.conf
new file mode 100644 (file)
index 0000000..e94fe49
--- /dev/null
@@ -0,0 +1,14 @@
+options {
+       directory "../regression-tests/zones/";
+       recursion no;
+       listen-on port 5300 {
+               127.0.0.1;
+       };
+       version "Meow!Meow!";
+       minimal-responses yes;
+};
+
+zone "minimal.com"{
+       type master;
+       file "./minimal.com";
+};
diff --git a/regression-tests.nobackend/default-publish-cds/pdns.conf b/regression-tests.nobackend/default-publish-cds/pdns.conf
new file mode 100644 (file)
index 0000000..4eca48a
--- /dev/null
@@ -0,0 +1,14 @@
+daemon=no
+local-port=5503
+socket-dir=./
+no-shuffle
+cache-ttl=0
+query-cache-ttl=0
+module-dir=../regression-tests/modules
+launch=bind
+bind-config=default-publish-cds/named.conf
+bind-dnssec-db=default-publish-cds/bind-dnssec.db
+loglevel=9
+distributor-threads=1
+default-publish-cds=4
+domain-metadata-cache-ttl=0
\ No newline at end of file