]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
[master] improve rrchecker test
authorEvan Hunt <each@isc.org>
Fri, 11 Sep 2015 07:24:47 +0000 (00:24 -0700)
committerEvan Hunt <each@isc.org>
Fri, 11 Sep 2015 07:24:47 +0000 (00:24 -0700)
4203. [test] The rrchecker system test now tests conversion
to and from unkonwn-type format. [RT #40584]

CHANGES
bin/tests/system/rrchecker/tests.sh
bin/tools/named-rrchecker.c

diff --git a/CHANGES b/CHANGES
index aca3372dbf330273d76a7e8e085a575bea9fd7d9..fbfa004a2c502dccd8ddb05646eb222f7e87bfd6 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+4203.  [test]          The rrchecker system test now tests conversion
+                       to and from unkonwn-type format. [RT #40584]
+
 4202.  [bug]           isccc_cc_fromwire() could return an incorrect
                        result. [RT #40614]
 
index 71b14219a3ba15f5a308a65e04eb332cbc9c9d5b..349f0a5828f843140b7043894d0fc7bdd0c7512a 100644 (file)
@@ -38,19 +38,42 @@ $*
 EOF
 }
 
+echo "I:check conversions to canonical format"
 ret=0
 $SHELL ../genzone.sh 0 > tempzone
 $CHECKZONE -Dq . tempzone | sed '/^;/d' |
 while read -r n tt cl ty rest
 do
        myecho "$cl $ty $rest" | $RRCHECKER -p > checker.out || {
-               ret=1;
-               echo "I: '$cl $ty $rest' not handled.";
+               ret=1
+               echo "I: '$cl $ty $rest' not handled."
        }
        read -r cl0 ty0 rest0 < checker.out
        test "$cl $ty $rest" = "$cl0 $ty0 $rest0" || {
-               ret=1;
-               echo "I: '$cl $ty $rest' != '$cl0 $ty0 $rest0'";
+               ret=1
+               echo "I: '$cl $ty $rest' != '$cl0 $ty0 $rest0'"
+       }
+done
+test $ret -eq 0 || { echo "I:failed"; status=`expr $status + 1`; }
+
+echo "I:check conversions to and from unknown record format"
+ret=0
+$CHECKZONE -Dq . tempzone | sed '/^;/d' |
+while read -r n tt cl ty rest
+do
+       myecho "$cl $ty $rest" | $RRCHECKER -u > checker.out || {
+               ret=1
+               echo "I: '$cl $ty $rest' not converted to unknown record format"
+       }
+       read -r clu tyu restu < checker.out
+       myecho "$clu $tyu $restu" | $RRCHECKER -p > checker.out || {
+               ret=1
+               echo "I: '$cl $ty $rest' not converted back to canonical format"
+       }
+       read -r cl0 ty0 rest0 < checker.out
+       test "$cl $ty $rest" = "$cl0 $ty0 $rest0" || {
+               ret=1
+               echo "I: '$cl $ty $rest' != '$cl0 $ty0 $rest0'"
        }
 done
 test $ret -eq 0 || { echo "I:failed"; status=`expr $status + 1`; }
index 7994838e1ac366bf4b19fa633eebe2c36f5954fb..1c168baf284fa0438569168a6f4dc9009b9fc7aa 100644 (file)
@@ -40,13 +40,14 @@ static isc_lexspecials_t specials;
 
 static void
 usage(void) {
-       fprintf(stderr, "usage: named-rrchecker [-o origin] [-hpCPT]\n");
+       fprintf(stderr, "usage: named-rrchecker [-o origin] [-hpCPTu]\n");
        fprintf(stderr, "\t-h: print this help message\n");
        fprintf(stderr, "\t-o origin: set origin to be used when interpeting the record\n");
        fprintf(stderr, "\t-p: print the record in cannonical format\n");
        fprintf(stderr, "\t-C: list the supported class names\n");
-       fprintf(stderr, "\t-T: list the supported standard type names\n");
        fprintf(stderr, "\t-P: list the supported private type names\n");
+       fprintf(stderr, "\t-T: list the supported standard type names\n");
+       fprintf(stderr, "\t-u: print the record in unknown record format\n");
 }
 
 int