Skip to content

Commit 189eef8

Browse files
committed
System Touch
1 parent 8b41c16 commit 189eef8

2 files changed

Lines changed: 12 additions & 5 deletions

File tree

scripts/bash/49152/test.49152.check.sh

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
set -e
44
HOST="${1:-localhost}"
55
PORT=49152
6-
TIMEOUT=3
6+
TIMEOUT=5
77

88
echo "[test] Checking port $PORT on $HOST..."
99

scripts/bash/49152/test.49152.connect.sh

100644100755
Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,22 @@
11
#!/usr/bin/env bash
22
# Test: Start a telnet connection to port 49152 and verify banner response
3+
# The server uses a polling loop (500ms) + session handler to send banner.
4+
# The ConnectionPoller needs to poll CURRENT_CONNECTIONS before greet() fires.
5+
# Keep stdin open with sleep so the server has time to respond.
36
set -e
47
HOST="${1:-localhost}"
58
PORT=49152
6-
TIMEOUT=5
9+
TIMEOUT=12
710

8-
echo "[test] Connecting to $HOST:$PORT..."
11+
echo "[test] Connecting to $HOST:$PORT (waiting up to ${TIMEOUT}s for banner)..."
912

10-
RESPONSE=$(echo "" | timeout "$TIMEOUT" nc -w "$TIMEOUT" "$HOST" "$PORT" 2>/dev/null || true)
13+
RESPONSE=$( (sleep "$TIMEOUT") | timeout "$TIMEOUT" nc -w "$TIMEOUT" "$HOST" "$PORT" 2>/dev/null | head -20 || true)
1114

12-
if [ -n "$RESPONSE" ]; then
15+
if echo "$RESPONSE" | grep -qi "N21\|NATIONAL\|FINANCE\|Welcome"; then
16+
echo "[PASS] Connection established. Server banner received:"
17+
echo "$RESPONSE" | head -10
18+
exit 0
19+
elif [ -n "$RESPONSE" ]; then
1320
echo "[PASS] Connection established. Server response:"
1421
echo "$RESPONSE" | head -10
1522
exit 0

0 commit comments

Comments
 (0)