QUICK_TEST_REFERENCE.md•4.2 kB
# Hostaway MCP Server - Quick Test Reference
Last Tested: 2025-10-28 19:57:25 UTC
## Quick Test Commands
### Basic Health Check
```bash
curl http://localhost:8000/health | jq
```
### Run Full Test Suite
```bash
python3 test_live_server.py http://localhost:8000
```
### Check SSH Tunnel Status
```bash
ps aux | grep "36353\|8000.*8080" | grep -v grep
```
### View Server Uptime
```bash
curl -s http://localhost:8000/health | jq '.context_protection.uptime_seconds / 3600'
```
## Test Results Summary (Latest)
- **Status:** ALL TESTS PASSED
- **Total Tests:** 37
- **Pass Rate:** 100%
- **Performance:** 162.86ms average (Excellent)
- **Server Uptime:** 216.74 hours (9+ days)
## Public Endpoints (No Auth Required)
```bash
# Root endpoint
curl http://localhost:8000/
# Health check
curl http://localhost:8000/health
# OpenAPI specification
curl http://localhost:8000/openapi.json | jq
# Swagger UI (open in browser)
open http://localhost:8000/docs
```
## Protected Endpoints (Require X-API-Key)
```bash
# Example with API key
curl -H "X-API-Key: your-api-key-here" http://localhost:8000/api/listings
# Expected without API key (should return 401)
curl http://localhost:8000/api/listings
# Response: {"detail":"401: Missing API key. Provide X-API-Key header."}
```
## Error Testing
```bash
# Test 404 handling
curl http://localhost:8000/invalid-endpoint
# Test validation error (422)
curl -X POST -H "Content-Type: application/json" \
-d '{"invalid":"data"}' \
http://localhost:8000/auth/authenticate
```
## Performance Testing
```bash
# Quick response time check
time curl -s http://localhost:8000/health > /dev/null
# Multiple requests
for i in {1..10}; do
curl -s -w "Response time: %{time_total}s\n" \
http://localhost:8000/health > /dev/null
done
```
## Infrastructure
### SSH Tunnel
- **PID:** 36353 (parent), 36363 (ssh process)
- **Local Port:** 8000
- **Remote Port:** 8080 (VPS)
- **Script:** `/Users/darrenmorgan/AI_Projects/hostaway-mcp/scripts/start-ssh-tunnel.sh`
### Check Tunnel Status
```bash
# Check if tunnel is running
lsof -i :8000
# Restart tunnel if needed
./scripts/start-ssh-tunnel.sh
```
## Expected Responses
### Healthy Server
```json
{
"status": "healthy",
"timestamp": "2025-10-28T09:27:26.006964+00:00",
"version": "0.1.0",
"service": "hostaway-mcp",
"context_protection": {
"total_requests": 0,
"uptime_seconds": 780104.88
}
}
```
### Authentication Error (Expected for Protected Endpoints)
```json
{
"detail": "401: Missing API key. Provide X-API-Key header."
}
```
### Not Found Error
```json
{
"detail": "Not Found"
}
```
## Test Categories
1. Health Check (9 tests) - Server health and metrics
2. Root Endpoint (5 tests) - Service metadata
3. OpenAPI Spec (5 tests) - API documentation
4. Swagger UI (2 tests) - Interactive docs
5. Error Handling (4 tests) - 404, 422 responses
6. Authentication (8 tests) - Security enforcement
7. Performance (4 tests) - Response times
## Quick Troubleshooting
### Server Not Responding
```bash
# Check if tunnel is active
ps -p 36353
# Check if port 8000 is open
lsof -i :8000
# Test direct connection to VPS (if you have access)
ssh -i ~/.ssh/hostaway-deploy root@72.60.233.157 "curl http://localhost:8080/health"
```
### Slow Response Times
```bash
# Check average response time
for i in {1..5}; do
curl -s -w "%{time_total}\n" -o /dev/null http://localhost:8000/health
done
```
### Authentication Issues
```bash
# Verify error message format
curl -v http://localhost:8000/api/listings 2>&1 | grep -E "HTTP|detail"
```
## Files Generated
- **Test Script:** `/Users/darrenmorgan/AI_Projects/hostaway-mcp/test_live_server.py`
- **Detailed Report:** `/Users/darrenmorgan/AI_Projects/hostaway-mcp/TEST_REPORT.md`
- **Quick Reference:** `/Users/darrenmorgan/AI_Projects/hostaway-mcp/QUICK_TEST_REFERENCE.md`
## Next Steps
1. Monitor server uptime and performance
2. Test with actual API keys (when available)
3. Set up HTTPS for direct access (optional)
4. Add Prometheus metrics endpoint (optional)
5. Configure rate limit headers visibility (optional)
---
**Last Test Status:** ALL PASSED (37/37)
**Production Readiness:** READY
**Health Score:** 10/10