]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
check xsl vs xml
authorMark Andrews <marka@isc.org>
Mon, 20 May 2019 05:24:03 +0000 (15:24 +1000)
committerEvan Hunt <each@isc.org>
Wed, 26 Jun 2019 21:03:53 +0000 (14:03 -0700)
bin/tests/system/conf.sh.in
bin/tests/system/statistics/clean.sh
bin/tests/system/statistics/ns3/named.conf.in
bin/tests/system/statistics/tests.sh

index 818661062bc3fc883886aedeeafd56a3a2c0e79f..f13681cb9921e7387984497883c9a7f706158998 100644 (file)
@@ -100,6 +100,9 @@ CURL=@CURL@
 # XMLLINT will be empty if no program was found by configure
 XMLLINT=@XMLLINT@
 
+# XSLTPROC will be empty if no program was found by configure
+XSLTPROC=@XSLTPROC@
+
 # PERL will be an empty string if no perl interpreter was found.
 PERL=@PERL@
 
index c730331031b4f1e784b7ed528162379109198968..9d23604818dbd018bbd54d745f27c687b59c13d6 100644 (file)
@@ -25,3 +25,4 @@ rm -f curl.out.*
 rm -f ns*/named.lock
 rm -f stats*out
 rm -f ns*/managed-keys.bind*
+rm -f xsltproc.out.*
index c3c9208870db453c2d1da7c6ac91f120ef8540d0..73bd5b57f8ea88c2cf62623ecd28a161087d3aa4 100644 (file)
@@ -22,6 +22,8 @@ options {
        dnssec-validation yes;
        notify yes;
        qname-minimization disabled;
+       zone-statistics yes;
+       glue-cache yes;
 };
 
 statistics-channels {
@@ -47,3 +49,9 @@ zone "example" {
        allow-update { any; };
        file "internal.db";
 };
+
+zone "a-slave" {
+       type slave;
+       file "slave.bk";
+       masters { 10.53.0.1; };
+};
index ce9d7eab1e42f4165629ae07a6f3c6687f6a3568..ccbca44996817a50fa8fe5bc34d243bdf2d67b57 100644 (file)
@@ -154,6 +154,58 @@ if [ $ret != 0 ]; then echo_i "failed"; fi
 status=`expr $status + $ret`
 n=`expr $n + 1`
 
+ret=0
+echo_i "checking bind9.xsl vs xml ($n)"
+if $FEATURETEST --have-libxml2 && [ -x "${CURL}" ] && [ -x "${XSLTPROC}" ]  ; then
+    $DIGCMD +notcp +recurse @10.53.0.3 soa . > /dev/null 2>&1
+    $DIGCMD +notcp +recurse @10.53.0.3 soa example > /dev/null 2>&1
+    ${CURL} http://10.53.0.3:${EXTRAPORT1}/xml/v3 > curl.out.${n}.xml 2>/dev/null || ret=1
+    ${CURL} http://10.53.0.3:${EXTRAPORT1}/bind9.xsl > curl.out.${n}.xsl 2>/dev/null || ret=1
+    ${XSLTPROC} curl.out.${n}.xsl - < curl.out.${n}.xml > xsltproc.out.${n} 2>/dev/null || ret=1
+    #
+    # grep for expected sections.
+    #
+    grep "<h1>ISC Bind 9 Configuration and Statistics</h1>" xsltproc.out.${n} >/dev/null || ret=1
+    grep "<h2>Server Status</h2>" xsltproc.out.${n} >/dev/null || ret=1
+    grep "<h2>Incoming Requests by DNS Opcode</h2>" xsltproc.out.${n} >/dev/null || ret=1
+    grep "<h3>Incoming Queries by Query Type</h3>" xsltproc.out.${n} >/dev/null || ret=1
+    grep "<h2>Outgoing Queries per view</h2>" xsltproc.out.${n} >/dev/null || ret=1
+    grep "<h3>View " xsltproc.out.${n} >/dev/null || ret=1
+    grep "<h2>Server Statistics</h2>" xsltproc.out.${n} >/dev/null || ret=1
+    grep "<h2>Zone Maintenance Statistics</h2>" xsltproc.out.${n} >/dev/null || ret=1
+    grep "<h2>Resolver Statistics (Common)</h2>" xsltproc.out.${n} >/dev/null || ret=1
+    grep "<h3>Resolver Statistics for View " xsltproc.out.${n} >/dev/null || ret=1
+    grep "<h3>ADB Statistics for View " xsltproc.out.${n} >/dev/null || ret=1
+    grep "<h3>Cache Statistics for View " xsltproc.out.${n} >/dev/null || ret=1
+    # grep "<h3>Cache DB RRsets for View " xsltproc.out.${n} >/dev/null || ret=1
+    grep "<h2>Traffic Size Statistics</h2>" xsltproc.out.${n} >/dev/null || ret=1
+    grep "<h4>UDP Requests Received</h4>" xsltproc.out.${n} >/dev/null || ret=1
+    grep "<h4>UDP Responses Sent</h4>" xsltproc.out.${n} >/dev/null || ret=1
+    grep "<h4>TCP Requests Received</h4>" xsltproc.out.${n} >/dev/null || ret=1
+    grep "<h4>TCP Responses Sent</h4>" xsltproc.out.${n} >/dev/null || ret=1
+    grep "<h2>Socket I/O Statistics</h2>" xsltproc.out.${n} >/dev/null || ret=1
+    grep "<h3>Zones for View " xsltproc.out.${n} >/dev/null || ret=1
+    grep "<h2>Received QTYPES per view/zone</h2>" xsltproc.out.${n} >/dev/null || ret=1
+    grep "<h3>View _default" xsltproc.out.${n} >/dev/null || ret=1
+    grep "<h4>Zone example" xsltproc.out.${n} >/dev/null || ret=1
+    grep "<h2>Response Codes per view/zone</h2>" xsltproc.out.${n} >/dev/null || ret=1
+    grep "<h3>View _default" xsltproc.out.${n} >/dev/null || ret=1
+    grep "<h4>Zone example" xsltproc.out.${n} >/dev/null || ret=1
+    # grep "<h2>Glue cache statistics</h2>" xsltproc.out.${n} >/dev/null || ret=1
+    grep "<h3>View _default" xsltproc.out.${n} >/dev/null || ret=1
+    grep "<h4>Zone example" xsltproc.out.${n} >/dev/null || ret=1
+    grep "<h2>Network Status</h2>" xsltproc.out.${n} >/dev/null || ret=1
+    grep "<h2>Task Manager Configuration</h2>" xsltproc.out.${n} >/dev/null || ret=1
+    grep "<h2>Tasks</h2>" xsltproc.out.${n} >/dev/null || ret=1
+    grep "<h2>Memory Usage Summary</h2>" xsltproc.out.${n} >/dev/null || ret=1
+    grep "<h2>Memory Contexts</h2>" xsltproc.out.${n} >/dev/null || ret=1
+else
+    echo_i "skipping test as libxml2 and/or curl and/or xsltproc was not found"
+fi
+if [ $ret != 0 ]; then echo_i "failed"; fi
+status=`expr $status + $ret`
+n=`expr $n + 1`
+
 ret=0
 echo_i "checking priming queries are counted ($n)"
 grep "1 priming queries" ns3/named.stats