]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
handle flushing of entries just before a second ticks over, speed up priming of the...
authorMark Andrews <marka@isc.org>
Thu, 1 Sep 2011 05:28:14 +0000 (05:28 +0000)
committerMark Andrews <marka@isc.org>
Thu, 1 Sep 2011 05:28:14 +0000 (05:28 +0000)
bin/tests/system/cacheclean/tests.sh

index b1578ad28b7fc8a6101165ce182822157ae6da4a..e9384e051ab3b22ff9e311cfbb28fa204c424f8f 100644 (file)
@@ -15,7 +15,7 @@
 # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 # PERFORMANCE OF THIS SOFTWARE.
 
-# $Id: tests.sh,v 1.9 2011/08/29 03:31:29 marka Exp $
+# $Id: tests.sh,v 1.10 2011/09/01 05:28:14 marka Exp $
 
 SYSTEMTESTTOP=..
 . $SYSTEMTESTTOP/conf.sh
@@ -32,22 +32,24 @@ load_cache () {
         $RNDC $RNDCOPTS flush
 
        # load the positive cache entries
-       $DIG $DIGOPTS txt top1.flushtest.example > /dev/null 2>1
-       $DIG $DIGOPTS txt second1.top1.flushtest.example > /dev/null 2>1
-       $DIG $DIGOPTS txt third1.second1.top1.flushtest.example > /dev/null 2>1
-       $DIG $DIGOPTS txt third2.second1.top1.flushtest.example > /dev/null 2>1
-       $DIG $DIGOPTS txt second2.top1.flushtest.example > /dev/null 2>1
-       $DIG $DIGOPTS txt second3.top1.flushtest.example > /dev/null 2>1
-       $DIG $DIGOPTS txt second1.top2.flushtest.example > /dev/null 2>1
-       $DIG $DIGOPTS txt second2.top2.flushtest.example > /dev/null 2>1
-       $DIG $DIGOPTS txt second3.top2.flushtest.example > /dev/null 2>1
-       $DIG $DIGOPTS txt top3.flushtest.example > /dev/null 2>1
-       $DIG $DIGOPTS txt second1.top3.flushtest.example > /dev/null 2>1
-       $DIG $DIGOPTS txt third1.second1.top3.flushtest.example > /dev/null 2>1
-       $DIG $DIGOPTS txt third2.second1.top3.flushtest.example > /dev/null 2>1
-       $DIG $DIGOPTS txt third1.second2.top3.flushtest.example > /dev/null 2>1
-       $DIG $DIGOPTS txt third2.second2.top3.flushtest.example > /dev/null 2>1
-       $DIG $DIGOPTS txt second3.top3.flushtest.example > /dev/null 2>1
+       $DIG $DIGOPTS -f - << EOF > /dev/null 2>1
+txt top1.flushtest.example
+txt second1.top1.flushtest.example
+txt third1.second1.top1.flushtest.example
+txt third2.second1.top1.flushtest.example
+txt second2.top1.flushtest.example
+txt second3.top1.flushtest.example
+txt second1.top2.flushtest.example
+txt second2.top2.flushtest.example
+txt second3.top2.flushtest.example
+txt top3.flushtest.example
+txt second1.top3.flushtest.example
+txt third1.second1.top3.flushtest.example
+txt third2.second1.top3.flushtest.example
+txt third1.second2.top3.flushtest.example
+txt third2.second2.top3.flushtest.example
+txt second3.top3.flushtest.example
+EOF
 
        # load the negative cache entries
         # nxrrset:
@@ -57,8 +59,8 @@ load_cache () {
         # empty nonterminal:
        $DIG $DIGOPTS txt second2.top3.flushtest.example > /dev/null
 
-       # sleep one second ensure the TTLs will be lower on cached data
-       sleep 1
+       # sleep 2 seconds ensure the TTLs will be lower on cached data
+       sleep 2
 }
 
 dump_cache () {
@@ -75,10 +77,10 @@ in_cache () {
         ttl=`$DIG $DIGOPTS "$@" | awk '{print $2}'`
         [ -z "$ttl" ] && {
                 ttl=`$DIG $DIGOPTS +noanswer +auth "$@" | awk '{print $2}'`
-                [ "$ttl" -eq 3600 ] && return 1
+                [ "$ttl" -ge 3599 ] && return 1
                 return 0
         }
-        [ "$ttl" -eq 3600 ] && return 1
+        [ "$ttl" -ge 3599 ] && return 1
         return 0
 }