From 4104577f6d633e362331e72b95fc5d0f78ceea3f Mon Sep 17 00:00:00 2001 From: Seebs Date: Mon, 31 Oct 2022 15:28:50 -0500 Subject: [PATCH] make smoketest setup check for empty strings Apparently terraform can give us output saying that it succeded, but give us an empty string for an IP address, which doesn't actually let us use the IP address. Check for that case too in our overly fancy setup. This is a precursor to figuring out what's going wrong in a way that lets us fix it more properly. Also, request values, but don't instant-exit if they aren't present, so we can actually do the retries. --- qa/scripts/setupSmokeTest.sh | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/qa/scripts/setupSmokeTest.sh b/qa/scripts/setupSmokeTest.sh index 4df2ca052..546cd5868 100755 --- a/qa/scripts/setupSmokeTest.sh +++ b/qa/scripts/setupSmokeTest.sh @@ -34,16 +34,33 @@ while ! $okay && [ $tries -le $max_tries ] ; do terraform output -json > outputs.json echo "Outputs:" cat outputs.json - must_get_value outputs.json TMP_I .ingest_ips 0 '"value"' 0 - must_get_value outputs.json TMP_D .data_node_ips 0 '"value"' 0 + get_value outputs.json TMP_I .ingest_ips 0 '"value"' 0 + get_value outputs.json TMP_D .data_node_ips 0 '"value"' 0 echo "TF status: $tf, ingest_ips $TMP_I, data_node_ips $TMP_D" - case $TMP_I.$TMP_D in - *null*) echo >&2 "looks like we failed, null in IPs." - tries=$(expr $tries + 1) + okay_i=false + okay_d=false + case $TMP_I in + null) echo >&2 "looks like we failed, null in ingest IPs." ;; - *) okay=true + "") echo >&2 "looks like we failed, empty string in ingest IPs." + ;; + *) okay_i=true ;; esac + case $TMP_D in + null) echo >&2 "looks like we failed, null in data IPs." + ;; + "") echo >&2 "looks like we failed, empty string in data IPs." + ;; + *) okay_d=true + ;; + esac + if $okay_i && $okay_d; then + okay=true + else + echo >&2 "retrying" + tries=$(expr $tries + 1) + fi done echo "okay $okay, tries $tries" if ! $okay; then