]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Make retry_quiet() available on Windows
authorMichał Kępień <michal@isc.org>
Thu, 16 Jan 2020 20:37:06 +0000 (21:37 +0100)
committerMichał Kępień <michal@isc.org>
Thu, 16 Jan 2020 20:37:06 +0000 (21:37 +0100)
When retry_quiet() was backported to v9_11, it was only placed in
bin/tests/system/conf.sh.in, but not in bin/tests/system/conf.sh.win32.
This prevents every system test which employs this shell function either
directly or indirectly from ever succeeding on Windows.  Fix by copying
the definition of retry_quiet() to bin/tests/system/conf.sh.win32.

bin/tests/system/conf.sh.win32

index fa4a2cbbd15790bd9713c755ab7497be73f77c79..d0b02fba76e0573a6f8798327a2277908609a065 100644 (file)
@@ -433,9 +433,9 @@ wait_for_log_peek() (
         return 1
 )
 
-# retry: keep running a command until it succeeds, up to $1 times, with
-# one-second intervals
-retry() {
+# _retry: keep running a command until it succeeds, up to $1 times, with
+# one-second intervals, optionally printing a message upon every attempt
+_retry() {
        __retries="${1}"
        shift
 
@@ -445,7 +445,9 @@ retry() {
                fi
                __retries=$((__retries-1))
                if [ "${__retries}" -gt 0 ]; then
-                       echo_i "retrying"
+                       if [ "${__retry_quiet}" -ne 1 ]; then
+                               echo_i "retrying"
+                       fi
                        sleep 1
                else
                        return 1
@@ -453,6 +455,18 @@ retry() {
        done
 }
 
+# retry: call _retry() in verbose mode
+retry() {
+       __retry_quiet=0
+       _retry "$@"
+}
+
+# retry_quiet: call _retry() in silent mode
+retry_quiet() {
+       __retry_quiet=1
+       _retry "$@"
+}
+
 # rndc_dumpdb: call "rndc dumpdb [...]" and wait until it completes
 #
 # The first argument is the name server instance to send the command to, in the