]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#9513 Fixup test020
authorHoward Chu <hyc@openldap.org>
Tue, 23 Mar 2021 20:08:30 +0000 (20:08 +0000)
committerQuanah Gibson-Mount <quanah@openldap.org>
Wed, 31 Mar 2021 18:53:50 +0000 (18:53 +0000)
Remove dependency on number of fields in debug output

tests/scripts/test020-proxycache

index bb0090ad2dd2bfd1d7c41ab717fb2fd665c12b69..4ff67220bae08c57d1d593e31265190094895d45 100755 (executable)
@@ -313,18 +313,12 @@ FIRST=$CNT
 
 # queries 2-6,8-10 are cacheable
 CACHEABILITY=0111110111
-grep CACHEABLE $LOG2 | awk '{ 
-               if ($3 == "NOT") 
-                       printf "Query %d not cacheable\n",NR
-               else 
-                       printf "Query %d cacheable\n",NR
-       }' 
-CACHED=`grep CACHEABLE $LOG2 | awk '{ 
-               if ($3 == "NOT") 
-                       printf "0" 
-               else 
-                       printf "1" 
-       }'`
+grep CACHEABLE $LOG2 | awk '
+               /NOT CACHEABLE/{printf "Query %d not cacheable\n",NR}
+               /QUERY CACHEABLE/{printf "Query %d cacheable\n",NR}'
+CACHED=`grep CACHEABLE $LOG2 | awk '
+               /NOT CACHEABLE/{printf "0"}
+               /QUERY CACHEABLE/{printf "1"}'`
 
 if test "$CACHEABILITY" = "$CACHED" ; then
        echo "Successfully verified cacheability"
@@ -466,22 +460,12 @@ fi
 #not answerable because of sizelimit, queries contained in it are no longer
 #answerable as well
 ANSWERABILITY=1110011
-grep ANSWERABLE $LOG2 | awk "BEGIN {FIRST=$FIRST}"'{ 
-               if (NR > FIRST) { 
-                       if ($3 == "NOT") 
-                               printf "Query %d not answerable\n",NR
-                       else 
-                               printf "Query %d answerable\n",NR 
-               }
-       }' 
-ANSWERED=`grep ANSWERABLE $LOG2 | awk "BEGIN {FIRST=$FIRST}"'{ 
-               if (NR > FIRST) { 
-                       if ($3 == "NOT") 
-                               printf "0" 
-                       else 
-                               printf "1"
-               } 
-       }'`
+grep ANSWERABLE $LOG2 | awk "BEGIN {FIRST=$FIRST}"'
+               /NOT ANSWERABLE/{if (NR > FIRST) printf "Query %d not answerable\n",NR}
+               /QUERY ANSWERABLE/{if (NR > FIRST) printf "Query %d answerable\n",NR}'
+ANSWERED=`grep ANSWERABLE $LOG2 | awk "BEGIN {FIRST=$FIRST}"'
+               /NOT ANSWERABLE/{if (NR > FIRST) printf "0"}
+               /QUERY ANSWERABLE/{if (NR > FIRST) printf "1"}'`
 
 if test "$ANSWERABILITY" = "$ANSWERED" ; then
        echo "Successfully verified answerability"