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

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

diff --git a/CHANGES b/CHANGES
index e17a1a33ce8a1296616208ef221fce08a187667d..7c4b38dea70bd2438a4eebddb083c6302163bf9c 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,5 @@
+3928.  [test]          Improve rndc system test. [RT #36898]
+
 3927.  [bug]           dig: report PKCS#11 error codes correctly when
                        compiled with --enable-native-pkcs11. [RT #36956]
 
index a9f13d3399bf16d6e3004e81a802117513f7053c..8a22990eb34a0b2b802ab57a4b9ff71125eecd63 100644 (file)
@@ -348,5 +348,35 @@ grep "number of zones: 98 (97 automatic)" rndc.status > /dev/null || ret=1
 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.4 -p 9956 -c ns4/key6.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.4 -p 9956 -c ns4/key6.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.4 -p 9956 -c ns4/key6.conf querylog on >/dev/null 2>&1 || ret=1
+# query for builtin and check if query was logged
+$DIG @10.53.0.4 -p 5300 -c ch -t txt foo12345.bind > /dev/null || ret 1
+grep "query logging is now on" ns4/named.run > /dev/null || ret=1
+grep "query: foo12345.bind CH TXT" ns4/named.run > /dev/null || ret=1
+# toggle query logging and check again
+$RNDC -s 10.53.0.4 -p 9956 -c ns4/key6.conf querylog > /dev/null 2>&1 || ret=1
+# query for another builtin zone and check if query was logged
+$DIG @10.53.0.4 -p 5300 -c ch -t txt foo9876.bind > /dev/null || ret 1
+grep "query logging is now off" ns4/named.run > /dev/null || ret=1
+grep "query: foo9876.bind CH TXT" ns4/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