-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_api.sh
More file actions
executable file
·36 lines (30 loc) · 917 Bytes
/
test_api.sh
File metadata and controls
executable file
·36 lines (30 loc) · 917 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/sh
# test_api.sh - Manual test for API server
echo "Testing API server on port 8081..."
# Test if server is running
if pgrep -f "simple_http_server.sh" > /dev/null; then
echo "✓ API server process is running"
else
echo "✗ API server process is NOT running"
exit 1
fi
# Test if port is listening
if netstat -tln 2>/dev/null | grep -q ":8081 "; then
echo "✓ Port 8081 is listening"
else
echo "✗ Port 8081 is NOT listening"
fi
# Test API endpoint
echo "Testing /api/test endpoint..."
response=$(busybox wget -q -O - --timeout=5 http://127.0.0.1:8081/api/test 2>/dev/null)
if [ $? -eq 0 ] && [ -n "$response" ]; then
echo "✓ API test successful:"
echo "$response"
else
echo "✗ API test failed"
echo "Response: $response"
fi
# Check logs
echo ""
echo "Recent server logs:"
tail -10 /data/adb/IntegrityHelper/server.log 2>/dev/null || echo "No server logs found"