implement test server

This commit is contained in:
2026-04-09 22:31:31 +03:00
parent 45a4687067
commit ef16e3bfb2
3 changed files with 125 additions and 4 deletions
+39
View File
@@ -0,0 +1,39 @@
#!/bin/bash
# Script to test TCP connect/disconnect functionality
BASE_URL="http://127.0.0.1:8888"
echo "=== Test 1: Connect to TCP server ==="
echo "GET /api/connect"
curl -s "$BASE_URL/api/connect"
echo ""
echo ""
echo "=== Test 2: Attempt reconnect (already connected) ==="
echo "GET /api/connect"
curl -s "$BASE_URL/api/connect"
echo ""
echo ""
echo "=== Test 3: Disconnect from TCP server ==="
echo "GET /api/disconnect"
curl -s "$BASE_URL/api/disconnect"
echo ""
echo ""
echo "=== Test 4: Attempt disconnect (already disconnected) ==="
echo "GET /api/disconnect"
curl -s "$BASE_URL/api/disconnect"
echo ""
echo ""
echo "=== Test 5: Reconnect after disconnect ==="
echo "GET /api/connect"
curl -s "$BASE_URL/api/connect"
echo ""
echo ""
echo "=== Test 6: Final disconnect ==="
echo "GET /api/disconnect"
curl -s "$BASE_URL/api/disconnect"
echo ""