From ab9780d97117eb590b79d90ccacc8b25f372794a Mon Sep 17 00:00:00 2001 From: fomojola Date: Fri, 4 Sep 2020 16:49:47 -0400 Subject: [PATCH] Support for expected text with special characters Added a quote around the "$EXPECTED" to deal with text with restricted characters. While deploying a Spring Boot application, the content of the built-in health check is {"status":"UP"}. Unfortunately all my checks failed, because for some reason the comparison didn't like this content. remote: ! http://localhost/actuator/health: expected to but did not find: "{"status":"UP"}" remote: ! Check attempt 7/10 failed. After making this change, it works: I'm assuming the difference is that the presence of the quote characters in the content. --- plugins/scheduler-docker-local/check-deploy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/scheduler-docker-local/check-deploy b/plugins/scheduler-docker-local/check-deploy index 6e624a1d2..b7fb9994f 100755 --- a/plugins/scheduler-docker-local/check-deploy +++ b/plugins/scheduler-docker-local/check-deploy @@ -211,7 +211,7 @@ trigger-scheduler-docker-local-check-deploy() { # shellcheck disable=SC2086 if OUTPUT=$(curl -# $CURL_ARGS 2>&1); then # OUTPUT contains the HTTP response - if [[ "$OUTPUT" =~ $EXPECTED ]]; then + if [[ "$OUTPUT" =~ "$EXPECTED" ]]; then SUCCESS=1 break fi