]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
[v9_8] add to rndc test
authorEvan Hunt <each@isc.org>
Fri, 22 Aug 2014 23:40:36 +0000 (16:40 -0700)
committerEvan Hunt <each@isc.org>
Fri, 22 Aug 2014 23:40:36 +0000 (16:40 -0700)
3928. [test] Improve rndc system test. [RT #36898]

(cherry picked from commit 2401ee51d83a4cd9101398f30679fa4e6046c582)
(cherry picked from commit 06677f0b08e789ca91e59a5eed42605c16f28531)
(cherry picked from commit 3a1cd81ee15d51555da99dafd436bafc59583326)

CHANGES
bin/tests/system/rndc/tests.sh

diff --git a/CHANGES b/CHANGES
index 9eedc4622a72b7302811ac6e5efbf6a38819021d..369b5439f192bb69646293c4131ed2df971d4550 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,5 @@
+3928.  [test]          Improve rndc system test. [RT #36898]
+
 3925.  [bug]           DS lookup of RFC 1918 empty zones failed. [RT #36917]
 
 3924.  [bug]           Improve 'rndc addzone' error reporting. [RT #35187]
index e841267b8b8cd8c74c1ad337b90d90a2b057d5b6..f150983b23bccd55264d48391d1ea7ac465cd1b1 100644 (file)
@@ -49,5 +49,35 @@ done
 if [ $ret != 0 ]; then echo "I:failed"; fi
 status=`expr $status + $ret`
 
+echo "I:testing rndc with null command"
+ret=0
+$RNDC -s 10.53.0.3 -p 9953 -c ../common/rndc.conf null || ret=1
+if [ $ret != 0 ]; then echo "I:failed"; fi
+status=`expr $status + $ret`
+
+echo "I:testing rndc with unknown control channel command"
+ret=0
+$RNDC -s 10.53.0.3 -p 9953 -c ../common/rndc.conf obviouslynotacommand >/dev/null 2>&1 && ret=1
+# rndc: 'obviouslynotacommand' failed: unknown command
+if [ $ret != 0 ]; then echo "I:failed"; fi
+status=`expr $status + $ret`
+
+echo "I:testing rndc with querylog command"
+ret=0
+# first enable it with querylog on option
+$RNDC -s 10.53.0.3 -p 9953 -c ../common/rndc.conf querylog on >/dev/null 2>&1 || ret=1
+# query for builtin and check if query was logged
+$DIG @10.53.0.3 -p 5300 -c ch -t txt foo12345.bind > /dev/null || ret 1
+grep "query logging is now on" ns3/named.run > /dev/null || ret=1
+grep "query: foo12345.bind CH TXT" ns3/named.run > /dev/null || ret=1
+# toggle query logging and check again
+$RNDC -s 10.53.0.3 -p 9953 -c ../common/rndc.conf querylog >/dev/null 2>&1 || ret=1
+# query for another builtin zone and check if query was logged
+$DIG @10.53.0.3 -p 5300 -c ch -t txt foo9876.bind > /dev/null || ret 1
+grep "query logging is now off" ns3/named.run > /dev/null || ret=1
+grep "query: foo9876.bind CH TXT" ns3/named.run > /dev/null && ret=1
+if [ $ret != 0 ]; then echo "I:failed"; fi
+status=`expr $status + $ret`
+
 echo "I:exit status: $status"
 exit $status