From 975a8bbeb7b05d3639918fb9f009dcf1e5ddd497 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20A=CC=81lvaro?= Date: Fri, 31 Mar 2023 11:29:52 +0200 Subject: [PATCH] fix(test): Enable local and runner clients for netapi --- tests/salt-api/test.sh | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) 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 ..."