mirror of
https://github.com/TronoSfera/Law.git
synced 2026-05-18 10:03:45 +03:00
add security test 07
This commit is contained in:
parent
1e9b326dad
commit
d5fa325f58
2 changed files with 7 additions and 4 deletions
|
|
@ -5,6 +5,7 @@ BASE_URL="${1:-http://localhost:8081}"
|
||||||
CHAT_HEALTH_URL="${BASE_URL%/}/chat-health"
|
CHAT_HEALTH_URL="${BASE_URL%/}/chat-health"
|
||||||
BACKEND_HEALTH_URL="${BASE_URL%/}/health"
|
BACKEND_HEALTH_URL="${BASE_URL%/}/health"
|
||||||
EMAIL_HEALTH_URL="${BASE_URL%/}/email-health"
|
EMAIL_HEALTH_URL="${BASE_URL%/}/email-health"
|
||||||
|
CHECK_CHAT_HEALTH_SKIP_DOCKER_CHECKS="${CHECK_CHAT_HEALTH_SKIP_DOCKER_CHECKS:-0}"
|
||||||
|
|
||||||
check_http_200() {
|
check_http_200() {
|
||||||
url="$1"
|
url="$1"
|
||||||
|
|
@ -27,9 +28,11 @@ if ! check_http_200 "$EMAIL_HEALTH_URL"; then
|
||||||
exit 5
|
exit 5
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if docker compose ps --format json 2>/dev/null | grep -q '"Health":"unhealthy"'; then
|
if [ "$CHECK_CHAT_HEALTH_SKIP_DOCKER_CHECKS" != "1" ]; then
|
||||||
echo "[ALERT] at least one container has unhealthy state" >&2
|
if docker compose ps --format json 2>/dev/null | grep -q '"Health":"unhealthy"'; then
|
||||||
exit 4
|
echo "[ALERT] at least one container has unhealthy state" >&2
|
||||||
|
exit 4
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "[OK] chat-service, backend and email-service are healthy"
|
echo "[OK] chat-service, backend and email-service are healthy"
|
||||||
|
|
|
||||||
|
|
@ -164,7 +164,7 @@ run_local_smoke() {
|
||||||
candidate="$(echo "$candidate" | xargs)"
|
candidate="$(echo "$candidate" | xargs)"
|
||||||
[[ -z "$candidate" ]] && continue
|
[[ -z "$candidate" ]] && continue
|
||||||
|
|
||||||
if ./scripts/ops/check_chat_health.sh "$candidate" >/dev/null 2>&1 && \
|
if CHECK_CHAT_HEALTH_SKIP_DOCKER_CHECKS="$LOCAL_SMOKE_SKIP_DOCKER_CHECKS" ./scripts/ops/check_chat_health.sh "$candidate" >/dev/null 2>&1 && \
|
||||||
SECURITY_SMOKE_SKIP_DOCKER_CHECKS="$LOCAL_SMOKE_SKIP_DOCKER_CHECKS" ./scripts/ops/security_smoke.sh "$candidate" >/dev/null 2>&1; then
|
SECURITY_SMOKE_SKIP_DOCKER_CHECKS="$LOCAL_SMOKE_SKIP_DOCKER_CHECKS" ./scripts/ops/security_smoke.sh "$candidate" >/dev/null 2>&1; then
|
||||||
log "Local smoke checks passed via ${candidate} (attempt ${attempt}/${max_attempts})"
|
log "Local smoke checks passed via ${candidate} (attempt ${attempt}/${max_attempts})"
|
||||||
ok=1
|
ok=1
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue