]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
auth: add a bunch of passing rfc2136 TXT tests
authorPeter van Dijk <peter.van.dijk@powerdns.com>
Fri, 1 Jul 2022 07:44:24 +0000 (09:44 +0200)
committerPeter van Dijk <peter.van.dijk@powerdns.com>
Mon, 4 Jul 2022 11:23:42 +0000 (13:23 +0200)
(cherry picked from commit 9fca38077c5538d4a886629fc229f9b0f3150b02)

regression-tests/tests/1dyndns-update-add-delete-txt/command [new file with mode: 0755]
regression-tests/tests/1dyndns-update-add-delete-txt/description [new file with mode: 0644]
regression-tests/tests/1dyndns-update-add-delete-txt/expected_result [new file with mode: 0644]
regression-tests/tests/1dyndns-update-add-delete-txt/skip.nodyndns [new file with mode: 0644]

diff --git a/regression-tests/tests/1dyndns-update-add-delete-txt/command b/regression-tests/tests/1dyndns-update-add-delete-txt/command
new file mode 100755 (executable)
index 0000000..05d1f88
--- /dev/null
@@ -0,0 +1,132 @@
+#!/bin/sh
+
+## add + delete with explicit data
+
+# check all MX records
+cleandig test.dyndns TXT
+
+# add mx record
+cleannsupdate <<!
+server $nameserver $port
+zone test.dyndns
+update add test.dyndns. 3000 TXT 30 host-3.test.dyndns
+send
+answer
+!
+
+# check if record was really added
+cleandig test.dyndns TXT
+
+# delete the just added record
+cleannsupdate <<!
+server $nameserver $port
+zone test.dyndns
+update delete test.dyndns. 3000 TXT 30 host-3.test.dyndns
+send
+answer
+!
+
+# check if the record was deleted.
+cleandig test.dyndns TXT
+
+
+## add with explicit data (single string), remove whole RRset
+
+# add mx record
+cleannsupdate <<!
+server $nameserver $port
+zone test.dyndns
+update add test.dyndns. 3000 TXT "the quick brown fox"
+send
+answer
+!
+
+# check if record was really added
+cleandig test.dyndns TXT
+
+# delete the just added record
+cleannsupdate <<!
+server $nameserver $port
+zone test.dyndns
+update delete test.dyndns. 3000 TXT
+send
+answer
+!
+# check if the record was deleted.
+cleandig test.dyndns TXT
+
+## add with explicit data (single string), remove whole RRset
+
+# add mx record
+cleannsupdate <<!
+server $nameserver $port
+zone test.dyndns
+update add test.dyndns. 3000 TXT "the quick brown fox" "jumps over the lazy dog"
+send
+answer
+!
+
+# check if record was really added
+cleandig test.dyndns TXT
+
+# delete the just added record
+cleannsupdate <<!
+server $nameserver $port
+zone test.dyndns
+update delete test.dyndns. 3000 TXT
+send
+answer
+!
+# check if the record was deleted.
+cleandig test.dyndns TXT
+
+## add with explicit data (multiple strings, total over 255), remove whole RRset
+
+# add mx record
+cleannsupdate <<!
+server $nameserver $port
+zone test.dyndns
+update add test.dyndns. 3000 TXT "Now, why the chicken might have done it, I just couldn't say" "But if I'm gonna make it home, this is the only way" "Five lanes of traffic, an embankment, then a stream" "It's like it’s some kind of amphibianic fever dream" "The total lack of law enforcement on this road's a crime" "I'd write a letter, but I simply haven't got the time"
+send
+answer
+!
+
+# check if record was really added
+cleandig test.dyndns TXT
+
+# delete the just added record
+cleannsupdate <<!
+server $nameserver $port
+zone test.dyndns
+update delete test.dyndns. 3000 TXT
+send
+answer
+!
+# check if the record was deleted.
+cleandig test.dyndns TXT
+
+## add with explicit data (multiple strings, total over 255), remove whole RRset by content
+
+# add mx record
+cleannsupdate <<!
+server $nameserver $port
+zone test.dyndns
+update add test.dyndns. 3000 TXT "Now, why the chicken might have done it, I just couldn't say" "But if I'm gonna make it home, this is the only way" "Five lanes of traffic, an embankment, then a stream" "It's like it’s some kind of amphibianic fever dream" "The total lack of law enforcement on this road's a crime" "I'd write a letter, but I simply haven't got the time"
+send
+answer
+!
+
+# check if record was really added
+cleandig test.dyndns TXT
+
+# delete the just added record
+cleannsupdate <<!
+server $nameserver $port
+zone test.dyndns
+update delete test.dyndns. 3000 TXT
+send
+answer
+!
+# check if the record was deleted.
+cleandig test.dyndns TXT
+
diff --git a/regression-tests/tests/1dyndns-update-add-delete-txt/description b/regression-tests/tests/1dyndns-update-add-delete-txt/description
new file mode 100644 (file)
index 0000000..9956f4b
--- /dev/null
@@ -0,0 +1,2 @@
+A test to see if RFC2136 add and delete record works properly on a TXT records,
+including TXT records containing multiple strings.
diff --git a/regression-tests/tests/1dyndns-update-add-delete-txt/expected_result b/regression-tests/tests/1dyndns-update-add-delete-txt/expected_result
new file mode 100644 (file)
index 0000000..14b69e0
--- /dev/null
@@ -0,0 +1,93 @@
+1      test.dyndns.    IN      SOA     3600    ns1.test.dyndns. ahu.example.dyndns. 2022070126 28800 7200 604800 86400
+Rcode: 0 (No Error), RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
+Reply to question for qname='test.dyndns.', qtype=TXT
+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
+
+0      test.dyndns.    IN      TXT     3000    "30" "host-3.test.dyndns"
+Rcode: 0 (No Error), RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
+Reply to question for qname='test.dyndns.', qtype=TXT
+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
+
+1      test.dyndns.    IN      SOA     3600    ns1.test.dyndns. ahu.example.dyndns. 2022070128 28800 7200 604800 86400
+Rcode: 0 (No Error), RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
+Reply to question for qname='test.dyndns.', qtype=TXT
+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
+
+0      test.dyndns.    IN      TXT     3000    "the quick brown fox"
+Rcode: 0 (No Error), RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
+Reply to question for qname='test.dyndns.', qtype=TXT
+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
+
+1      test.dyndns.    IN      SOA     3600    ns1.test.dyndns. ahu.example.dyndns. 2022070130 28800 7200 604800 86400
+Rcode: 0 (No Error), RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
+Reply to question for qname='test.dyndns.', qtype=TXT
+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
+
+0      test.dyndns.    IN      TXT     3000    "the quick brown fox" "jumps over the lazy dog"
+Rcode: 0 (No Error), RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
+Reply to question for qname='test.dyndns.', qtype=TXT
+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
+
+1      test.dyndns.    IN      SOA     3600    ns1.test.dyndns. ahu.example.dyndns. 2022070132 28800 7200 604800 86400
+Rcode: 0 (No Error), RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
+Reply to question for qname='test.dyndns.', qtype=TXT
+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
+
+0      test.dyndns.    IN      TXT     3000    "Now, why the chicken might have done it, I just couldn't say" "But if I'm gonna make it home, this is the only way" "Five lanes of traffic, an embankment, then a stream" "It's like it\226\128\153s some kind of amphibianic fever dream" "The total lack of law enforcement on this road's a crime" "I'd write a letter, but I simply haven't got the time"
+Rcode: 0 (No Error), RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
+Reply to question for qname='test.dyndns.', qtype=TXT
+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
+
+1      test.dyndns.    IN      SOA     3600    ns1.test.dyndns. ahu.example.dyndns. 2022070134 28800 7200 604800 86400
+Rcode: 0 (No Error), RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
+Reply to question for qname='test.dyndns.', qtype=TXT
+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
+
+0      test.dyndns.    IN      TXT     3000    "Now, why the chicken might have done it, I just couldn't say" "But if I'm gonna make it home, this is the only way" "Five lanes of traffic, an embankment, then a stream" "It's like it\226\128\153s some kind of amphibianic fever dream" "The total lack of law enforcement on this road's a crime" "I'd write a letter, but I simply haven't got the time"
+Rcode: 0 (No Error), RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
+Reply to question for qname='test.dyndns.', qtype=TXT
+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
+
+1      test.dyndns.    IN      SOA     3600    ns1.test.dyndns. ahu.example.dyndns. 2022070136 28800 7200 604800 86400
+Rcode: 0 (No Error), RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
+Reply to question for qname='test.dyndns.', qtype=TXT
diff --git a/regression-tests/tests/1dyndns-update-add-delete-txt/skip.nodyndns b/regression-tests/tests/1dyndns-update-add-delete-txt/skip.nodyndns
new file mode 100644 (file)
index 0000000..81c071b
--- /dev/null
@@ -0,0 +1 @@
+Skip this test if the backend does not support dyndns/rfc2136