From dc4577e506b4690fb7b6cf0e797846cc6f484c18 Mon Sep 17 00:00:00 2001 From: Evan Hunt Date: Fri, 11 Sep 2015 00:25:06 -0700 Subject: [PATCH] [v9_10] improve rrchecker test 4203. [test] The rrchecker system test now tests conversion to and from unkonwn-type format. [RT #40584] --- CHANGES | 3 +++ bin/tests/system/rrchecker/tests.sh | 31 +++++++++++++++++++++++++---- bin/tools/named-rrchecker.c | 5 +++-- 3 files changed, 33 insertions(+), 6 deletions(-) diff --git a/CHANGES b/CHANGES index b490266784..6d506bc827 100644 --- 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] diff --git a/bin/tests/system/rrchecker/tests.sh b/bin/tests/system/rrchecker/tests.sh index 71b14219a3..349f0a5828 100644 --- a/bin/tests/system/rrchecker/tests.sh +++ b/bin/tests/system/rrchecker/tests.sh @@ -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`; } diff --git a/bin/tools/named-rrchecker.c b/bin/tools/named-rrchecker.c index 7994838e1a..1c168baf28 100644 --- a/bin/tools/named-rrchecker.c +++ b/bin/tools/named-rrchecker.c @@ -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