]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
rt38571: handle Time::Piece not being supported by perl
authorMark Andrews <marka@isc.org>
Wed, 18 Feb 2015 12:49:33 +0000 (23:49 +1100)
committerMark Andrews <marka@isc.org>
Wed, 18 Feb 2015 12:49:33 +0000 (23:49 +1100)
bin/tests/system/dnssec/tests.sh

index 14ace41f996f6839481030763a155913b31ff6e0..3dfc0457d2ac9d113359ed171be1fb32e95b27a5 100644 (file)
@@ -2040,14 +2040,20 @@ lines=`wc -l < rndc.out.ns4.test$n.1`
 ts=`awk '{print $3" "$4}' < rndc.out.ns4.test$n.1`
 # rndc nta outputs localtime, so append the timezone
 ts_with_zone="$ts `date +%z`"
-# ntadiff.pl computes $ts_with_zone - ($added + 1week)
-d=`$PERL ./ntadiff.pl "$ts_with_zone" "$added"`
 echo "ts=$ts" > rndc.out.ns4.test$n.2
 echo "ts_with_zone=$ts_with_zone" >> rndc.out.ns4.test$n.2
-echo "d=$d" >> rndc.out.ns4.test$n.2
-# diff from $added(now) + 1week to the clamped NTA lifetime should be
-# less than a few seconds.
-[ $d -lt 10 ] || ret=1
+echo "added=$added" >> rndc.out.ns4.test$n.2
+if $PERL -e 'use Time::Piece; use Time::Seconds;' 2>/dev/null
+then
+    # ntadiff.pl computes $ts_with_zone - ($added + 1week)
+    d=`$PERL ./ntadiff.pl "$ts_with_zone" "$added"`
+    echo "d=$d" >> rndc.out.ns4.test$n.2
+    # diff from $added(now) + 1week to the clamped NTA lifetime should be
+    # less than a few seconds.
+    [ $d -lt 10 ] || ret=1
+else
+    echo "I: skipped ntadiff test; install PERL module Time::Piece"
+fi
 
 # cleanup
 $RNDC -c ../common/rndc.conf -s 10.53.0.4 -p 9953 nta -remove secure.example > rndc.out.ns4.test$n.3 2>/dev/null