#!/bin/bash set -eo pipefail cd "$(dirname "$0")" LAST=0; [ -f .check_time ] && read -r LAST < .check_time TMO=$(( LAST + 30 )) [ $TMO -lt 90 ] && TMO=90 START=$(date +%s) TMP=$(mktemp) timeout $TMO make check -j4 > "$TMP" 2>&1 || { tail -40 "$TMP"; rm -f "$TMP" [ $(date +%s) -ge $((START + TMO)) ] && echo "TIMEOUT (${TMO}s)" >&2 exit 1 } grep -E '\[PASS|\[FAIL|\[SKIP|Test Results|Failed tests|Log directory|^====' "$TMP" rm -f "$TMP" # Интеграционный тест tcp_proxy_full (требует sudo; без passwordless sudo — пропускаем) echo "" if [ "$(id -u)" -eq 0 ]; then make -C tests check-proxy make -C tests check-burst make -C tests check-load elif command -v sudo >/dev/null 2>&1 && sudo -n true 2>/dev/null; then echo "=== tcp_proxy_full integration test (sudo) ===" sudo -n make -C tests check-proxy echo "=== tcp_proxy_full burst test (sudo) ===" sudo -n make -C tests check-burst echo "=== tcp_proxy_full load test (sudo) ===" sudo -n make -C tests check-load else echo "[SKIP] tcp_proxy_full integration test (requires passwordless sudo)" fi ELAPSED=$(( $(date +%s) - START )) echo "Time: ${ELAPSED}s" echo "$ELAPSED" > .check_time