Blame bin/tests/virtual-time/slave/tests.sh

Packit Service ae04f2
#!/bin/sh
Packit Service ae04f2
#
Packit Service ae04f2
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
Packit Service ae04f2
#
Packit Service ae04f2
# This Source Code Form is subject to the terms of the Mozilla Public
Packit Service ae04f2
# License, v. 2.0. If a copy of the MPL was not distributed with this
Packit Service ae04f2
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
Packit Service ae04f2
#
Packit Service ae04f2
# See the COPYRIGHT file distributed with this work for additional
Packit Service ae04f2
# information regarding copyright ownership.
Packit Service ae04f2
Packit Service ae04f2
SYSTEMTESTTOP=..
Packit Service ae04f2
. $SYSTEMTESTTOP/conf.sh
Packit Service ae04f2
Packit Service ae04f2
status=0
Packit Service ae04f2
Packit Service ae04f2
rm -f dig.out.*
Packit Service ae04f2
Packit Service ae04f2
DIGOPTS="+tcp +noadd +nosea +nostat +nocmd -p 5300"
Packit Service ae04f2
Packit Service ae04f2
echo "I:checking slave expiry"
Packit Service ae04f2
ret=0
Packit Service ae04f2
$DIG $DIGOPTS txt.example. txt @10.53.0.1 > dig.out.before || ret=1
Packit Service ae04f2
echo "I:waiting for expiry (10s real, 6h virtual)"
Packit Service ae04f2
sleep 10
Packit Service ae04f2
$DIG $DIGOPTS txt.example. txt @10.53.0.1 > dig.out.after || ret=1
Packit Service ae04f2
if [ $ret != 0 ]; then echo "I:failed"; fi
Packit Service ae04f2
status=`expr $status + $ret`
Packit Service ae04f2
Packit Service ae04f2
ret=0
Packit Service ae04f2
grep "status: NOERROR" dig.out.before > /dev/null || ret=1
Packit Service ae04f2
if [ $ret -eq 1 ] ; then
Packit Service ae04f2
    echo "I:failed (before)"; status=1
Packit Service ae04f2
fi
Packit Service ae04f2
ret=0
Packit Service ae04f2
grep "status: SERVFAIL" dig.out.after > /dev/null || ret=1
Packit Service ae04f2
if [ $ret -eq 1 ] ; then
Packit Service ae04f2
    echo "I:failed (after)"; status=1
Packit Service ae04f2
fi
Packit Service ae04f2
Packit Service ae04f2
echo "I:exit status: $status"
Packit Service ae04f2
exit $status