[v9_10] improve rrchecker test

4203.	[test]		The rrchecker system test now tests conversion
			to and from unkonwn-type format. [RT #40584]
This commit is contained in:
Evan Hunt 2015-09-11 00:25:06 -07:00
parent 918a74ff08
commit dc4577e506
3 changed files with 33 additions and 6 deletions

View file

@ -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]

View 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`; }

View 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