diff --git a/tests/salt-api/test.sh b/tests/salt-api/test.sh index fbebb68..ae19446 100755 --- a/tests/salt-api/test.sh +++ b/tests/salt-api/test.sh @@ -20,6 +20,16 @@ export SALTAPI_EAUTH=pam echo "==> Creating salt-api configuration file ..." mkdir -p "${SCRIPT_PATH}/config" cat > "${SCRIPT_PATH}/config/salt-api.conf" < Testing curl command ..." -curl -sSk "${SALTAPI_URL}" \ +CURL_OUTPUT="$(curl -sSk "${SALTAPI_URL}" \ -H "Accept: application/x-yaml" \ -H "X-Auth-Token: ${SALTAPI_TOKEN}" \ -d client=runner \ -d tgt='*' \ - -d fun=test.stream \ -| grep -i true || error "curl command" + -d fun=test.stream)" +echo "${CURL_OUTPUT}" + +echo -n "${CURL_OUTPUT}" | grep -i true || error "curl command" ok "curl command" # Stop and start with salt-api pass via file @@ -85,16 +97,18 @@ SALTAPI_TOKEN=$(curl -sSk "${SALTAPI_URL%/}/login" \ [ -n "${SALTAPI_TOKEN}" ] || error "salt-api token" ok "salt-api token" -# Test salt-api command +# Test salt-api command via curl echo "==> Testing curl command (pass via file) ..." -curl -sSk "${SALTAPI_URL}" \ +CURL_OUTPUT="$(curl -sSk "${SALTAPI_URL}" \ -H "Accept: application/x-yaml" \ -H "X-Auth-Token: ${SALTAPI_TOKEN}" \ -d client=runner \ -d tgt='*' \ - -d fun=test.stream \ -| grep -i true || error "curl command" -ok "curl command" + -d fun=test.stream)" +echo "${CURL_OUTPUT}" + +echo -n "${CURL_OUTPUT}" | grep -i true || error "curl command (pass via file)" +ok "curl command (pass via file)" # Install salt-pepper echo "==> Installing salt-pepper ..."