]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Make "autosign" system test work with BusyBox awk
authorMichał Kępień <michal@isc.org>
Tue, 30 Jul 2019 19:08:40 +0000 (21:08 +0200)
committerMichał Kępień <michal@isc.org>
Tue, 30 Jul 2019 20:22:28 +0000 (22:22 +0200)
The BusyBox version of awk treats some variables which other awk
implementations consider to be decimal values as octal values.  This
intermittently breaks key event interval calculations in the "autosign"
system test, trigger false positives for it.  Prevent the problem from
happening by stripping leading zeros from the affected awk variables.

(cherry picked from commit ad008f7dbfe1861d8b67cd223b30c8d602991f22)

bin/tests/system/autosign/tests.sh

index 267f1e682989160ba814b1162236e1f2fbb7d2ba..94ca0b5cd6b9cbd4a77c61668268cf341e8a2a04 100755 (executable)
@@ -1173,7 +1173,7 @@ status=`expr $status + $ret`
 # event scheduled is within 10 seconds of expected interval.
 check_interval () {
         awk '/next key event/ {print $2 ":" $9}' $1/named.run |
-       sed 's/\.//g' |
+       sed -e 's/\.//g' -e 's/:0\{1,4\}/:/g' |
             awk -F: '
                      {
                        x = ($6+ $5*60000 + $4*3600000) - ($3+ $2*60000 + $1*3600000);