]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
New test to check if soa-serial updates
authorRuben d'Arco <cyclops@prof-x.net>
Fri, 15 Feb 2013 17:08:40 +0000 (18:08 +0100)
committermind04 <mind04@monshouwer.org>
Fri, 12 Jul 2013 15:22:04 +0000 (17:22 +0200)
regression-tests/1dyndns-check-soa-update/command [new file with mode: 0755]
regression-tests/1dyndns-check-soa-update/description [new file with mode: 0644]
regression-tests/1dyndns-check-soa-update/expected_result [new file with mode: 0755]
regression-tests/1dyndns-check-soa-update/skip.nodyndns [new file with mode: 0644]
regression-tests/getserial [new file with mode: 0755]

diff --git a/regression-tests/1dyndns-check-soa-update/command b/regression-tests/1dyndns-check-soa-update/command
new file mode 100755 (executable)
index 0000000..90560f6
--- /dev/null
@@ -0,0 +1,27 @@
+#!/bin/sh
+BEFORE=$(getserial test.dyndns)
+
+cleannsupdate <<!
+server $nameserver $port
+zone test.dyndns
+update add dummy.test.dyndns 600 A 127.0.0.1
+send
+answer
+!
+
+AFTER1=$(getserial test.dyndns)
+
+cleannsupdate <<!
+server $nameserver $port
+zone test.dyndns
+update delete dummy.test.dyndns 600 A 127.0.0.1
+send
+answer
+!
+
+AFTER2=$(getserial test.dyndns)
+
+if [ $((AFTER2 - AFTER1)) -lt 1 ] || [ $((AFTER1 - BEFORE)) -lt 1 ]
+then
+       echo "SOA was not raised!";
+fi
diff --git a/regression-tests/1dyndns-check-soa-update/description b/regression-tests/1dyndns-check-soa-update/description
new file mode 100644 (file)
index 0000000..97380c1
--- /dev/null
@@ -0,0 +1,3 @@
+RFC2136 describes that every update message should result in the SOA-serial to be changed.
+This test checks if that happens.
+
diff --git a/regression-tests/1dyndns-check-soa-update/expected_result b/regression-tests/1dyndns-check-soa-update/expected_result
new file mode 100755 (executable)
index 0000000..4b87927
--- /dev/null
@@ -0,0 +1,12 @@
+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
+
+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/1dyndns-check-soa-update/skip.nodyndns b/regression-tests/1dyndns-check-soa-update/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
diff --git a/regression-tests/getserial b/regression-tests/getserial
new file mode 100755 (executable)
index 0000000..dfba167
--- /dev/null
@@ -0,0 +1,2 @@
+#!/bin/sh
+../pdns/sdig $nameserver $port $1 SOA | LC_ALL=C sort | grep ^0 | cut -d ' ' -f 3