2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 22:45:39 +00:00

date +%s is not portable, use perl -e 'print time();', Adjust messages

This commit is contained in:
Mark Andrews
2011-05-30 22:32:06 +00:00
parent 4e3be43e8a
commit ae0691566a

View File

@@ -14,7 +14,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE. # PERFORMANCE OF THIS SOFTWARE.
# $Id: tests.sh,v 1.28 2011/05/30 07:25:19 marka Exp $ # $Id: tests.sh,v 1.29 2011/05/30 22:32:06 marka Exp $
SYSTEMTESTTOP=.. SYSTEMTESTTOP=..
. $SYSTEMTESTTOP/conf.sh . $SYSTEMTESTTOP/conf.sh
@@ -765,7 +765,7 @@ file="ns1/`cat vanishing.key`.private"
rm -f $file rm -f $file
echo "I:preparing ZSK roll" echo "I:preparing ZSK roll"
starttime=`date +%s` starttime=`$PERL -e 'print time(), "\n";'`
oldfile=`cat active.key` oldfile=`cat active.key`
oldid=`sed 's/^K.+007+0*//' < active.key` oldid=`sed 's/^K.+007+0*//' < active.key`
newfile=`cat standby.key` newfile=`cat standby.key`
@@ -912,17 +912,17 @@ n=`expr $n + 1`
if [ $ret != 0 ]; then echo "I:failed"; fi if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret` status=`expr $status + $ret`
echo "I:checking former active key was removed ($n)"
# #
# Work out how long we need to sleep. Allow 4 seconds for the records # Work out how long we need to sleep. Allow 4 seconds for the records
# to be removed. # to be removed.
# #
now=`date +%s` now=`$PERL -e 'print time(), "\n";'`
sleep=`expr $starttime + 29 - $now` sleep=`expr $starttime + 29 - $now`
case $sleep in case $sleep in
-*|0);; -*|0);;
*) echo "I: sleep $sleep"; sleep $sleep;; *) echo "I:waiting for timer to have activated"; sleep $sleep;;
esac esac
echo "I:checking former active key was removed ($n)"
ret=0 ret=0
$DIG $DIGOPTS +multi dnskey . @10.53.0.1 > dig.out.ns1.test$n || ret=1 $DIG $DIGOPTS +multi dnskey . @10.53.0.1 > dig.out.ns1.test$n || ret=1
grep '; key id =.*'"$oldid"'$' dig.out.ns1.test$n > /dev/null && ret=1 grep '; key id =.*'"$oldid"'$' dig.out.ns1.test$n > /dev/null && ret=1