From 129b51f9d181fe47c5076fc141dd505ddf498b3f Mon Sep 17 00:00:00 2001 From: Tim Kimber Date: Thu, 23 Feb 2023 16:19:02 +0000 Subject: [PATCH] Trim newline from uri (intermittent test failure) Fix sleep calc for bash4-2/centos7 in check_github_quota --- getssl | 2 ++ test/test_helper.bash | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/getssl b/getssl index af7848d..7ff71bb 100755 --- a/getssl +++ b/getssl @@ -1418,6 +1418,8 @@ for d in "${alldomains[@]}"; do # get the token and uri from the dns-01 component token=$(json_get "$response" "challenges" "type" "dns-01" "token") uri=$(json_get "$response" "challenges" "type" "dns-01" "url") + # when using pebble this sometimes appears to have a newline which causes problems in send_signed_request + uri=$(echo "$uri" | tr -d '\r') debug uri "$uri" fi diff --git a/test/test_helper.bash b/test/test_helper.bash index 4688300..4a02872 100644 --- a/test/test_helper.bash +++ b/test/test_helper.bash @@ -38,8 +38,8 @@ check_github_quota() { fi now="$(date +%s)" while [[ "$now" -lt "$reset" ]] ; do - echo "# sleeping $(( "$reset" - "$now" )) seconds for GitHub quota" - sleep "$(( "$reset" - "$now" ))" + echo "# sleeping $(( reset - now )) seconds for GitHub quota" + sleep "$(( reset - now ))" now="$(date +%s)" done done