]> granicus.if.org Git - pdns/commitdiff
Add test for case-sensative add/remove of hostname.
authorRuben d'Arco <cyclops@prof-x.net>
Fri, 15 Feb 2013 12:48:42 +0000 (13:48 +0100)
committermind04 <mind04@monshouwer.org>
Fri, 12 Jul 2013 15:22:03 +0000 (17:22 +0200)
regression-tests/1dyndns-update-add-delete-casesensative/command [new file with mode: 0755]
regression-tests/1dyndns-update-add-delete-casesensative/description [new file with mode: 0644]
regression-tests/1dyndns-update-add-delete-casesensative/expected_result [new file with mode: 0755]
regression-tests/1dyndns-update-add-delete-casesensative/skip.nodyndns [new file with mode: 0644]

diff --git a/regression-tests/1dyndns-update-add-delete-casesensative/command b/regression-tests/1dyndns-update-add-delete-casesensative/command
new file mode 100755 (executable)
index 0000000..bd56ee4
--- /dev/null
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+# check if add-delete.test.dyndns exists. It should not.
+cleandig dhcpd-host.test.dyndns ANY hidesoadetails
+
+# add a record
+cleannsupdate <<!
+server $nameserver $port
+zone test.dyndns
+update add dHCPD-host.test.dyndns. 60 A 127.0.0.1
+update add dHCPD-host.test.dyndns. 60 TXT "318188eb1a97d43928ccf8494d4a910c8a"
+send
+answer
+!
+
+# query if the record now exists
+cleandig dhcpd-host.test.dyndns ANY hidesoadetails
+
+# delete the just added record
+cleannsupdate <<!
+server $nameserver $port
+zone test.dyndns
+update delete dHCPD-host.test.dyndns. 0 A 127.0.0.1
+send
+answer
+!
+
+# check if the record was deleted.
+cleandig dhcpd-host.test.dyndns ANY hidesoadetails
+
+
+# delete the just added record
+cleannsupdate <<!
+server $nameserver $port
+zone test.dyndns
+update delete dHCPD-host.test.dyndns. 0 TXT "318188eb1a97d43928ccf8494d4a910c8a"
+send
+answer
+!
+
+# Check if the last one is gone.
+cleandig dhcpd-host.test.dyndns ANY hidesoadetails
diff --git a/regression-tests/1dyndns-update-add-delete-casesensative/description b/regression-tests/1dyndns-update-add-delete-casesensative/description
new file mode 100644 (file)
index 0000000..1270e64
--- /dev/null
@@ -0,0 +1,2 @@
+This test performs a simple add and delete of a A and TXT record. This is typically with ISC's DHCPD does.
+The interesting thing is the case-sensativity, as hosts can have capital letters in them (it's how you configure the dhcpd's client machine). 
diff --git a/regression-tests/1dyndns-update-add-delete-casesensative/expected_result b/regression-tests/1dyndns-update-add-delete-casesensative/expected_result
new file mode 100755 (executable)
index 0000000..1b538d1
--- /dev/null
@@ -0,0 +1,31 @@
+1      test.dyndns.    IN      SOA     3600    ns1.test.dyndns. ahu.example.dyndns. [serial] 28800 7200 604800 86400
+Rcode: 3, RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
+Reply to question for qname='dhcpd-host.test.dyndns.', qtype=ANY
+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      dhcpd-host.test.dyndns. IN      A       60      127.0.0.1
+0      dhcpd-host.test.dyndns. IN      TXT     60      "318188eb1a97d43928ccf8494d4a910c8a"
+Rcode: 0, RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
+Reply to question for qname='dhcpd-host.test.dyndns.', qtype=ANY
+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      dhcpd-host.test.dyndns. IN      TXT     60      "318188eb1a97d43928ccf8494d4a910c8a"
+Rcode: 0, RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
+Reply to question for qname='dhcpd-host.test.dyndns.', qtype=ANY
+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. [serial] 28800 7200 604800 86400
+Rcode: 3, RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0
+Reply to question for qname='dhcpd-host.test.dyndns.', qtype=ANY
diff --git a/regression-tests/1dyndns-update-add-delete-casesensative/skip.nodyndns b/regression-tests/1dyndns-update-add-delete-casesensative/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