diff --git a/acceptance/setup.sh b/acceptance/setup.sh index 7c8dd2c0111..525819f4179 100755 --- a/acceptance/setup.sh +++ b/acceptance/setup.sh @@ -35,13 +35,14 @@ DEBUG=true" > ${WRITE_ENVIRONMENT_FILE} echo "Wrote environment file ${WRITE_ENVIRONMENT_FILE}" cat ${WRITE_ENVIRONMENT_FILE} +DEFAULTORG_RESPONSE_RESULTS=0 # waiting for default organization -until $(echo "$DEFAULTORG_RESPONSE" | jq -r '.result | length') == 1 +until [ ${DEFAULTORG_RESPONSE_RESULTS} -eq 1 ] do - DEFAULTORG_RESPONSE=$(curl -s --request POST \ + DEFAULTORG_RESPONSE_RESULTS=$(curl -s --request POST \ --url "${ZITADEL_API_INTERNAL_URL}/v2/organizations/_search" \ --header "Authorization: Bearer ${PAT}" \ --header "Host: ${ZITADEL_API_DOMAIN}" \ - -d '{"queries": [{"defaultQuery": {}}]}' ) - echo "Received default organization response: ${DEFAULTORG_RESPONSE}" + -d '{"queries": [{"defaultQuery": {}}]}' | jq -r '.result | length') + echo "Received default organization response results: ${DEFAULTORG_RESPONSE_RESULTS}" done