aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rwxr-xr-xtests/run_test.sh46
1 files changed, 23 insertions, 23 deletions
diff --git a/tests/run_test.sh b/tests/run_test.sh
index 5173fa3..8a87824 100755
--- a/tests/run_test.sh
+++ b/tests/run_test.sh
@@ -29,18 +29,18 @@ FAILURES=0
# ── cleanup ────────────────────────────────────────────────────
cleanup() {
- [ -n "$LDS_PID" ] && kill "$LDS_PID" 2>/dev/null && wait "$LDS_PID" 2>/dev/null
- [ -n "$SR_PID" ] && kill "$SR_PID" 2>/dev/null && wait "$SR_PID" 2>/dev/null
- [ -n "$TMPFILE" ] && rm -f "$TMPFILE"
+ [ -n "$LDS_PID" ] && kill "$LDS_PID" 2>/dev/null && wait "$LDS_PID" 2>/dev/null
+ [ -n "$SR_PID" ] && kill "$SR_PID" 2>/dev/null && wait "$SR_PID" 2>/dev/null
+ [ -n "$TMPFILE" ] && rm -f "$TMPFILE"
}
trap cleanup EXIT
# ── port check ─────────────────────────────────────────────────
for port in $LDS_PORT $SR_PORT; do
- if ss -tlnp 2>/dev/null | grep -q ":${port} "; then
- echo "FAIL: port $port is already in use"
- exit 1
- fi
+ if ss -tlnp 2>/dev/null | grep -q ":${port} "; then
+ echo "FAIL: port $port is already in use"
+ exit 1
+ fi
done
# ── start LDS ──────────────────────────────────────────────────
@@ -48,8 +48,8 @@ build/ServerLDS "$CONFIG_DIR/server_lds.conf" >/dev/null 2>&1 &
LDS_PID=$!
sleep 2
if ! kill -0 "$LDS_PID" 2>/dev/null; then
- echo "FAIL: ServerLDS exited prematurely"
- exit 1
+ echo "FAIL: ServerLDS exited prematurely"
+ exit 1
fi
# ── start ServerRegister ───────────────────────────────────────
@@ -57,8 +57,8 @@ build/ServerRegister "$CONFIG_DIR/server_register.conf" >/dev/null 2>&1 &
SR_PID=$!
sleep 3
if ! kill -0 "$SR_PID" 2>/dev/null; then
- echo "FAIL: ServerRegister exited prematurely"
- exit 1
+ echo "FAIL: ServerRegister exited prematurely"
+ exit 1
fi
# ── run client ─────────────────────────────────────────────────
@@ -70,13 +70,13 @@ CLIENT_OUTPUT=$(<"$TMPFILE")
# ── validation checks ─────────────────────────────────────────
check() {
- local label="$1" result="$2"
- if [ "$result" -eq 0 ]; then
- echo "PASS: $label"
- else
- echo "FAIL: $label"
- FAILURES=$((FAILURES + 1))
- fi
+ local label="$1" result="$2"
+ if [ "$result" -eq 0 ]; then
+ echo "PASS: $label"
+ else
+ echo "FAIL: $label"
+ FAILURES=$((FAILURES + 1))
+ fi
}
# 1. Exit code
@@ -97,10 +97,10 @@ check "endpoint contains $EXPECTED_POLICY" $?
# ── result ─────────────────────────────────────────────────────
if [ "$FAILURES" -ne 0 ]; then
- echo ""
- echo "--- client output ---"
- echo "$CLIENT_OUTPUT"
- echo "--- end ---"
- exit 1
+ echo ""
+ echo "--- client output ---"
+ echo "$CLIENT_OUTPUT"
+ echo "--- end ---"
+ exit 1
fi
exit 0