From: Michał Kępień Date: Tue, 20 Feb 2018 12:59:29 +0000 (+0100) Subject: Improve the way cache contents are searched for "ns.flushtest.example" X-Git-Tag: v9.10.8rc1~88^2 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=3513a585e338425270cf2d7c63aa7a0b17444671;p=thirdparty%2Fbind9.git Improve the way cache contents are searched for "ns.flushtest.example" During the "check flushtree clears adb correctly" check, expecting "ns.flushtest.example" to always be the first name in the ADB dump is fragile, because in a certain corner case "a.root-servers.nil" will be the first name instead. As the purpose of the relevant check is to ensure "ns.flushtest.example" is removed from ADB by "rndc flushtree flushtest.example", search the entire list of names present in ADB instead of just the first entry when looking for "ns.flushtest.example". (cherry picked from commit ca1049b2f36be42a6daa9c04289d51c481cb7b52) --- diff --git a/bin/tests/system/cacheclean/tests.sh b/bin/tests/system/cacheclean/tests.sh index 475dfa79b73..e2304e496d5 100644 --- a/bin/tests/system/cacheclean/tests.sh +++ b/bin/tests/system/cacheclean/tests.sh @@ -228,11 +228,11 @@ ret=0 load_cache dump_cache mv ns2/named_dump.db.$n ns2/named_dump.db.$n.a -awk '/plain success\/timeout/ {getline; getline; if ($2 == "ns.flushtest.example") exit(0); exit(1); }' ns2/named_dump.db.$n.a || ret=1 +sed -n '/plain success\/timeout/,/Unassociated entries/p' ns2/named_dump.db.$n.a | grep 'ns.flushtest.example' > /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 -awk '/plain success\/timeout/ {getline; getline; if ($2 == "ns.flushtest.example") exit(1); exit(0); }' ns2/named_dump.db.$n.b || ret=1 +sed -n '/plain success\/timeout/,/Unassociated entries/p' ns2/named_dump.db.$n.b | grep 'ns.flushtest.example' > /dev/null 2>&1 && ret=1 if [ $ret != 0 ]; then echo "I:failed"; fi status=`expr $status + $ret`