]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
fix dnssec test
authorEvan Hunt <each@isc.org>
Thu, 24 Jan 2019 06:57:49 +0000 (22:57 -0800)
committerEvan Hunt <each@isc.org>
Fri, 25 Jan 2019 19:24:11 +0000 (11:24 -0800)
- work around CR issues
- use UTC for time comparisons
- use $DIFF instead of cmp

bin/tests/system/dnssec/ns2/sign.sh
bin/tests/system/dnssec/tests.sh

index 1ff1ed681b88c9aca0676777c438be8dd9e1a519..58f3f0d1d2546fbabe4bce43a109251868c6a774 100644 (file)
@@ -42,6 +42,7 @@ $SIGNER -P -g -r $RANDFILE -o $zone -k $keyname1 $zonefile $keyname2 > /dev/null
 # changing the last 4 characters will lead to a bad base64 encoding.
 #
 $CHECKZONE -D -q -i local $zone $zonefile.signed |
+tr -d '\r' |
 awk '
 tolower($1) == "bad-cname.example." && $4 == "RRSIG" && $5 == "CNAME" {
        for (i = 1; i <= NF; i++ ) {
index 882c7e6ba087f10dbaaf815686b3e88c18f689bc..7697c5d167473a8a6f312827975677faed06afd0 100644 (file)
@@ -1648,9 +1648,9 @@ echo_i "checking dnssec-signzone -N date ($n)"
 ret=0
 (
 cd signer
-$SIGNER -O full -f signer.out.9 -S -N date -o example example2.db > /dev/null 2>&1
+TZ=UTC $SIGNER -O full -f signer.out.9 -S -N date -o example example2.db > /dev/null 2>&1
 ) || ret=1
-now=`$PERL -e '@lt=localtime(); printf "%.4d%0.2d%0.2d00\n",$lt[5]+1900,$lt[4]+1,$lt[3];'`
+now=`TZ=UTC $PERL -e '@lt=localtime(); printf "%.4d%0.2d%0.2d00\n",$lt[5]+1900,$lt[4]+1,$lt[3];'`
 serial=`awk '/^;/ { next; } $4 == "SOA" { print $7 }' signer/signer.out.9`
 [ "$now" -eq "$serial" ] || ret=1
 n=`expr $n + 1`
@@ -2698,7 +2698,7 @@ ret=0
 $DIG $ANSWEROPTS +nottlid nosign.example ns @10.53.0.3 | \
         grep RRSIG | sed 's/[  ][      ]*/ /g' > dig.out.ns3.test$n 2>&1
 # the NS RRSIG should not be changed
-cmp -s nosign.before dig.out.ns3.test$n || ret=1
+$DIFF nosign.before dig.out.ns3.test$n > /dev/null|| ret=1
 n=`expr $n + 1`
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=`expr $status + $ret`