From ce2d75df01071a06ac08c8f5ba73a8fd78002da4 Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Thu, 4 Jun 2015 18:01:29 -0400 Subject: [PATCH] Remove hardcoded http in URL in sahara exercise script The script hardcoded http://$SERVICE_HOST/... which failed when SSL or tls-proxy was enabled. Calculate the protocol based on enabled services instead. Change-Id: I192eeeafe7bf4dc5cbd382c505ffb9307651d78a --- exercises/sahara.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/exercises/sahara.sh b/exercises/sahara.sh index 2589e28c0c..8cad94562d 100755 --- a/exercises/sahara.sh +++ b/exercises/sahara.sh @@ -35,7 +35,13 @@ source $TOP_DIR/exerciserc is_service_enabled sahara || exit 55 -$CURL_GET http://$SERVICE_HOST:8386/ 2>/dev/null | grep -q 'Auth' || die $LINENO "Sahara API isn't functioning!" +if is_ssl_enabled_service "sahara" || is_service_enabled tls-proxy; then + SAHARA_SERVICE_PROTOCOL="https" +fi + +SAHARA_SERVICE_PROTOCOL=${SAHARA_SERVICE_PROTOCOL:-$SERVICE_PROTOCOL} + +$CURL_GET $SAHARA_SERVICE_PROTOCOL://$SERVICE_HOST:8386/ 2>/dev/null | grep -q 'Auth' || die $LINENO "Sahara API isn't functioning!" set +o xtrace echo "*********************************************************************"