From 3761ea67149f73cea37a2fc08e43446806363bd1 Mon Sep 17 00:00:00 2001 From: Ed Santiago Date: Wed, 10 Nov 2021 19:56:33 -0700 Subject: [PATCH] Fix bug that prevented useful diagnostics on registry fail Sigh. 'expr 1 - 1' yields 0 (correctly) but also exits 1. This is even documented in the man page, but I didn't know it. And thus, on the final iteration, when timeout reached 0, BATS errored out on the expr instead of continuing to the 'podman logs' or the 'die' message. Solution is super trivial: use $(( ... )) instead of expr. Signed-off-by: Ed Santiago --- systemtest/helpers.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/systemtest/helpers.bash b/systemtest/helpers.bash index 8a3710ad..bf2c8c12 100644 --- a/systemtest/helpers.bash +++ b/systemtest/helpers.bash @@ -356,7 +356,7 @@ start_registry() { return fi - timeout=$(expr $timeout - 1) + timeout=$(( timeout - 1 )) sleep 1 done die "Timed out waiting for registry container to respond on :$port"