Use local API endpoint in smoke test
This commit is contained in:
@@ -9,6 +9,7 @@ PIKIT_SSH_KEY="${PIKIT_SSH_KEY:-$HOME/.ssh/pikit}"
|
|||||||
PIKIT_SSH_OPTS="${PIKIT_SSH_OPTS:-}"
|
PIKIT_SSH_OPTS="${PIKIT_SSH_OPTS:-}"
|
||||||
PIKIT_HTTP_URL="${PIKIT_HTTP_URL:-http://$PIKIT_HOST}"
|
PIKIT_HTTP_URL="${PIKIT_HTTP_URL:-http://$PIKIT_HOST}"
|
||||||
PIKIT_HTTPS_URL="${PIKIT_HTTPS_URL:-https://$PIKIT_HOST}"
|
PIKIT_HTTPS_URL="${PIKIT_HTTPS_URL:-https://$PIKIT_HOST}"
|
||||||
|
PIKIT_API_URL="${PIKIT_API_URL:-http://127.0.0.1:4000}"
|
||||||
|
|
||||||
LOCAL_ONLY=0
|
LOCAL_ONLY=0
|
||||||
ERRORS=0
|
ERRORS=0
|
||||||
@@ -126,7 +127,7 @@ check_https() {
|
|||||||
check_api() {
|
check_api() {
|
||||||
local url="$1"
|
local url="$1"
|
||||||
local body
|
local body
|
||||||
if ! body="$(curl -kfsSL --max-time 5 "$url")"; then
|
if ! body="$(remote_cmd "curl -fsS --max-time 5 $url")"; then
|
||||||
status FAIL "API not reachable: $url"
|
status FAIL "API not reachable: $url"
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
@@ -155,7 +156,7 @@ PY
|
|||||||
check_firstboot() {
|
check_firstboot() {
|
||||||
local url="$1"
|
local url="$1"
|
||||||
local body state error_present
|
local body state error_present
|
||||||
if ! body="$(curl -kfsSL --max-time 5 "$url")"; then
|
if ! body="$(remote_cmd "curl -fsS --max-time 5 $url")"; then
|
||||||
status FAIL "firstboot API not reachable"
|
status FAIL "firstboot API not reachable"
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
@@ -216,10 +217,10 @@ main() {
|
|||||||
check_https "$PIKIT_HTTPS_URL" "HTTPS"
|
check_https "$PIKIT_HTTPS_URL" "HTTPS"
|
||||||
|
|
||||||
section "API"
|
section "API"
|
||||||
check_api "$PIKIT_HTTP_URL/api/status"
|
check_api "$PIKIT_API_URL/api/status"
|
||||||
|
|
||||||
section "Firstboot"
|
section "Firstboot"
|
||||||
check_firstboot "$PIKIT_HTTP_URL/api/firstboot"
|
check_firstboot "$PIKIT_API_URL/api/firstboot"
|
||||||
|
|
||||||
section "Services"
|
section "Services"
|
||||||
check_services
|
check_services
|
||||||
|
|||||||
Reference in New Issue
Block a user