-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_all_endpoints.sh
More file actions
executable file
·35 lines (26 loc) · 1.16 KB
/
Copy pathtest_all_endpoints.sh
File metadata and controls
executable file
·35 lines (26 loc) · 1.16 KB
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
#!/bin/bash
# Test script for all Fleet Optimization API endpoints
# Usage: ./test_all_endpoints.sh
API_URL="${1:-http://localhost:8000}"
echo "Testing Fleet Optimization API at: ${API_URL}"
echo "=========================================="
echo -e "\n[1/4] Testing Root Endpoint..."
curl -s "${API_URL}/" | jq '.' 2>/dev/null || curl -s "${API_URL}/"
echo -e "\n[2/4] Testing Health Check..."
curl -s "${API_URL}/health" | jq '.' 2>/dev/null || curl -s "${API_URL}/health"
echo -e "\n[3/4] Testing Database Info..."
curl -s "${API_URL}/db/info" | jq '.' 2>/dev/null || curl -s "${API_URL}/db/info"
echo -e "\n[4/4] Testing Full Optimization..."
if [ -f "algorithm_config.json" ]; then
echo "Using algorithm_config.json..."
curl -s -X POST "${API_URL}/algorithm/run" \
-H "Content-Type: application/json" \
-d @algorithm_config.json | jq '.' 2>/dev/null || \
curl -s -X POST "${API_URL}/algorithm/run" \
-H "Content-Type: application/json" \
-d @algorithm_config.json
else
echo "⚠️ algorithm_config.json not found, skipping optimization test"
fi
echo -e "\n=========================================="
echo "✅ All tests completed!"