sdk_relay/tests/health_check.sh
4NK Dev bf339eb15a
All checks were successful
build-and-push-ext / build_push (push) Successful in 21s
ci: docker_tag=ext - Add curl to Dockerfile for healthcheck
2025-09-19 17:04:04 +00:00

24 lines
497 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
URL="http://localhost:8091/health"
echo "[tests] Vérification /health: $URL"
http_code=$(curl -s -o /tmp/health_body.txt -w "%{http_code}" "$URL")
body=$(cat /tmp/health_body.txt)
echo "HTTP $http_code"
echo "Body: $body"
if [[ "$http_code" != "200" ]]; then
echo "Échec: code HTTP inattendu" >&2
exit 1
fi
if [[ "$body" != '{"status":"ok"}' ]]; then
echo "Échec: corps inattendu" >&2
exit 1
fi
echo "Succès: endpoint /health opérationnel"