From d7cd9fe95b4fbfe6264aaea4e2e680f93ca972ec Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Wed, 21 Feb 2018 20:13:41 -0500 Subject: [PATCH] Merge branch '82-cacheclean-test-is-not-robust' into 'master' Resolve "cacheclean test is not robust." Closes #82 See merge request isc-projects/bind9!50 (cherry picked from commit aa7964dd4bf1ea01663cf6e8c5501d09f094726e) 146c16c0 check that sed selects a non zero range of lines 8c8ad74a add CHANGES entry --- CHANGES | 2 ++ bin/tests/system/cacheclean/clean.sh | 3 +-- bin/tests/system/cacheclean/tests.sh | 14 ++++++++++---- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/CHANGES b/CHANGES index dc7e7c2824..05bf91983c 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,5 @@ +4896. [test] cacheclean system test was not robust. [GL #82] + 4895. [test] Allow some system tests to run in parallel. [RT #46602] diff --git a/bin/tests/system/cacheclean/clean.sh b/bin/tests/system/cacheclean/clean.sh index 39396277ed..edb9a6e856 100644 --- a/bin/tests/system/cacheclean/clean.sh +++ b/bin/tests/system/cacheclean/clean.sh @@ -6,14 +6,13 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. -# $Id: clean.sh,v 1.8 2011/08/03 23:47:48 tbox Exp $ - # # Clean up after cache cleaner tests. # rm -f dig.out.ns2 rm -f dig.out.expire +rm -f sed.out.* rm -f */named.memstats rm -f */named.run rm -f ns2/named_dump.db.* diff --git a/bin/tests/system/cacheclean/tests.sh b/bin/tests/system/cacheclean/tests.sh index 56f96e667c..c68f97c86f 100644 --- a/bin/tests/system/cacheclean/tests.sh +++ b/bin/tests/system/cacheclean/tests.sh @@ -6,8 +6,6 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. -# $Id: tests.sh,v 1.10 2011/09/01 05:28:14 marka Exp $ - SYSTEMTESTTOP=.. . $SYSTEMTESTTOP/conf.sh @@ -221,11 +219,19 @@ ret=0 load_cache dump_cache mv ns2/named_dump.db.$n ns2/named_dump.db.$n.a -sed -n '/plain success\/timeout/,/Unassociated entries/p' ns2/named_dump.db.$n.a | grep 'ns.flushtest.example' > /dev/null 2>&1 || ret=1 +sed -n '/plain success\/timeout/,/Unassociated entries/p' \ + ns2/named_dump.db.$n.a > sed.out.$n.a +grep 'plain success/timeout' sed.out.$n.a > /dev/null 2>&1 || ret=1 +grep 'Unassociated entries' sed.out.$n.a > /dev/null 2>&1 || ret=1 +grep 'ns.flushtest.example' sed.out.$n.a > /dev/null 2>&1 || ret=1 $RNDC $RNDCOPTS flushtree flushtest.example || ret=1 dump_cache mv ns2/named_dump.db.$n ns2/named_dump.db.$n.b -sed -n '/plain success\/timeout/,/Unassociated entries/p' ns2/named_dump.db.$n.b | grep 'ns.flushtest.example' > /dev/null 2>&1 && ret=1 +sed -n '/plain success\/timeout/,/Unassociated entries/p' \ + ns2/named_dump.db.$n.b > sed.out.$n.b +grep 'plain success/timeout' sed.out.$n.b > /dev/null 2>&1 || ret=1 +grep 'Unassociated entries' sed.out.$n.b > /dev/null 2>&1 || ret=1 +grep 'ns.flushtest.example' sed.out.$n.b > /dev/null 2>&1 && ret=1 if [ $ret != 0 ]; then echo "I:failed"; fi status=`expr $status + $ret`