From: Evan Hunt Date: Thu, 24 Jan 2019 06:57:49 +0000 (-0800) Subject: fix dnssec test X-Git-Tag: v9.12.4rc1~44^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e37a32276e29bff51db28ebc7e507d0c4c87cbb5;p=thirdparty%2Fbind9.git fix dnssec test - work around CR issues - use UTC for time comparisons - use $DIFF instead of cmp --- diff --git a/bin/tests/system/dnssec/ns2/sign.sh b/bin/tests/system/dnssec/ns2/sign.sh index 1ff1ed681b8..58f3f0d1d25 100644 --- a/bin/tests/system/dnssec/ns2/sign.sh +++ b/bin/tests/system/dnssec/ns2/sign.sh @@ -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++ ) { diff --git a/bin/tests/system/dnssec/tests.sh b/bin/tests/system/dnssec/tests.sh index 882c7e6ba08..7697c5d1674 100644 --- a/bin/tests/system/dnssec/tests.sh +++ b/bin/tests/system/dnssec/tests.sh @@ -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`