From: Pieter Lexis Date: Fri, 16 Feb 2018 16:16:54 +0000 (+0100) Subject: dyndns: Add tests for the CNAME-with-other-data issue X-Git-Tag: dnsdist-1.3.0~71^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F6276%2Fhead;p=thirdparty%2Fpdns.git dyndns: Add tests for the CNAME-with-other-data issue --- diff --git a/regression-tests/tests/1dyndns-cname-and-other-data/command b/regression-tests/tests/1dyndns-cname-and-other-data/command new file mode 100755 index 0000000000..32ef5676e0 --- /dev/null +++ b/regression-tests/tests/1dyndns-cname-and-other-data/command @@ -0,0 +1,76 @@ +#!/bin/sh + +RECORDNAME=cname-and-other.test.dyndns + +echo '* Check if there is nothing there' +cleandig $RECORDNAME ANY hidesoadetails + +echo '* Try to add 2 records that are not allowed together (should lead to FORMERR)' +cleannsupdate <>HEADER<<- opcode: UPDATE, status: FORMERR, id: [id] +;; flags: qr aa; ZONE: 1, PREREQ: 0, UPDATE: 0, ADDITIONAL: 0 +;; ZONE SECTION: +;test.dyndns. IN SOA + +* check that indeed nothing was added +1 test.dyndns. IN SOA 3600 ns1.test.dyndns. ahu.example.dyndns. [serial] 28800 7200 604800 86400 +Rcode: 3 (Non-Existent domain), RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0 +Reply to question for qname='cname-and-other.test.dyndns.', qtype=A +1 test.dyndns. IN SOA 3600 ns1.test.dyndns. ahu.example.dyndns. [serial] 28800 7200 604800 86400 +Rcode: 3 (Non-Existent domain), RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0 +Reply to question for qname='cname-and-other.test.dyndns.', qtype=CNAME +* Add a CNAME +Answer: +;; ->>HEADER<<- opcode: UPDATE, status: NOERROR, id: [id] +;; flags: qr aa; ZONE: 1, PREREQ: 0, UPDATE: 0, ADDITIONAL: 0 +;; ZONE SECTION: +;test.dyndns. IN SOA + +* Attempt to add an A record (should be REFUSED) +Answer: +;; ->>HEADER<<- opcode: UPDATE, status: REFUSED, id: [id] +;; flags: qr aa; ZONE: 1, PREREQ: 0, UPDATE: 0, ADDITIONAL: 0 +;; ZONE SECTION: +;test.dyndns. IN SOA + +* Check that we only still have the CNAME +0 cname-and-other.test.dyndns. IN CNAME 3600 powerdns-cname.example. +Rcode: 0 (No Error), RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0 +Reply to question for qname='cname-and-other.test.dyndns.', qtype=A +* Delete the CNAME and add the A record in one go +Answer: +;; ->>HEADER<<- opcode: UPDATE, status: NOERROR, id: [id] +;; flags: qr aa; ZONE: 1, PREREQ: 0, UPDATE: 0, ADDITIONAL: 0 +;; ZONE SECTION: +;test.dyndns. IN SOA + +* Check that we have only the A-record +0 cname-and-other.test.dyndns. IN A 3600 192.0.2.1 +Rcode: 0 (No Error), RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0 +Reply to question for qname='cname-and-other.test.dyndns.', qtype=A +1 test.dyndns. IN SOA 3600 ns1.test.dyndns. ahu.example.dyndns. [serial] 28800 7200 604800 86400 +Rcode: 0 (No Error), RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0 +Reply to question for qname='cname-and-other.test.dyndns.', qtype=CNAME +* Attempt to add a CNAME (should be REFUSED) +Answer: +;; ->>HEADER<<- opcode: UPDATE, status: REFUSED, id: [id] +;; flags: qr aa; ZONE: 1, PREREQ: 0, UPDATE: 0, ADDITIONAL: 0 +;; ZONE SECTION: +;test.dyndns. IN SOA + +* check that we have only the A-record +0 cname-and-other.test.dyndns. IN A 3600 192.0.2.1 +Rcode: 0 (No Error), RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0 +Reply to question for qname='cname-and-other.test.dyndns.', qtype=ANY +* Clean up +Answer: +;; ->>HEADER<<- opcode: UPDATE, status: NOERROR, id: [id] +;; flags: qr aa; ZONE: 1, PREREQ: 0, UPDATE: 0, ADDITIONAL: 0 +;; ZONE SECTION: +;test.dyndns. IN SOA + diff --git a/regression-tests/tests/1dyndns-cname-and-other-data/skip.nodyndns b/regression-tests/tests/1dyndns-cname-and-other-data/skip.nodyndns new file mode 100644 index 0000000000..81c071b810 --- /dev/null +++ b/regression-tests/tests/1dyndns-cname-and-other-data/skip.nodyndns @@ -0,0 +1 @@ +Skip this test if the backend does not support dyndns/rfc2136