Files
aitbc/scripts/testing/test-all-services.sh
aitbc1 bfe6f94b75
Some checks failed
AITBC CI/CD Pipeline / lint-and-test (3.11) (push) Has been cancelled
AITBC CI/CD Pipeline / lint-and-test (3.12) (push) Has been cancelled
AITBC CI/CD Pipeline / lint-and-test (3.13) (push) Has been cancelled
AITBC CI/CD Pipeline / test-cli (push) Has been cancelled
AITBC CI/CD Pipeline / test-services (push) Has been cancelled
AITBC CI/CD Pipeline / test-production-services (push) Has been cancelled
AITBC CI/CD Pipeline / security-scan (push) Has been cancelled
AITBC CI/CD Pipeline / build (push) Has been cancelled
AITBC CI/CD Pipeline / deploy-staging (push) Has been cancelled
AITBC CI/CD Pipeline / deploy-production (push) Has been cancelled
AITBC CI/CD Pipeline / performance-test (push) Has been cancelled
AITBC CI/CD Pipeline / docs (push) Has been cancelled
AITBC CI/CD Pipeline / release (push) Has been cancelled
AITBC CI/CD Pipeline / notify (push) Has been cancelled
Security Scanning / Bandit Security Scan (apps/coordinator-api/src) (push) Has been cancelled
Security Scanning / Bandit Security Scan (cli/aitbc_cli) (push) Has been cancelled
Security Scanning / Bandit Security Scan (packages/py/aitbc-core/src) (push) Has been cancelled
Security Scanning / Bandit Security Scan (packages/py/aitbc-crypto/src) (push) Has been cancelled
Security Scanning / Bandit Security Scan (packages/py/aitbc-sdk/src) (push) Has been cancelled
Security Scanning / Bandit Security Scan (tests) (push) Has been cancelled
Security Scanning / CodeQL Security Analysis (javascript) (push) Has been cancelled
Security Scanning / CodeQL Security Analysis (python) (push) Has been cancelled
Security Scanning / Dependency Security Scan (push) Has been cancelled
Security Scanning / Container Security Scan (push) Has been cancelled
Security Scanning / OSSF Scorecard (push) Has been cancelled
Security Scanning / Security Summary Report (push) Has been cancelled
AITBC CLI Level 1 Commands Test / test-cli-level1 (3.11) (push) Has been cancelled
AITBC CLI Level 1 Commands Test / test-cli-level1 (3.12) (push) Has been cancelled
AITBC CLI Level 1 Commands Test / test-cli-level1 (3.13) (push) Has been cancelled
AITBC CLI Level 1 Commands Test / test-summary (push) Has been cancelled
chore: remove outdated documentation and reference files
- Remove debugging service documentation (DEBUgging_SERVICES.md)
- Remove development logs policy and quick reference guides
- Remove E2E test creation summary
- Remove gift certificate example file
- Remove GitHub pull summary documentation
2026-03-25 12:56:07 +01:00

129 lines
3.7 KiB
Bash
Executable File

#!/bin/bash
# AITBC Comprehensive Services Test Script
# Tests all services with new port logic implementation
set -euo pipefail
echo "=== 🧪 AITBC Comprehensive Services Test ==="
echo "Date: $(date)"
echo "Testing all services with new port logic (8000-8003, 8010-8016)"
echo ""
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
# Test results
PASSED=0
FAILED=0
# Function to test a service
test_service() {
local name="$1"
local url="$2"
local expected_pattern="$3"
echo -n "Testing $name... "
if response=$(curl -s "$url" 2>/dev/null); then
if [[ $response =~ $expected_pattern ]]; then
echo -e "${GREEN}✅ PASS${NC}"
((PASSED++))
return 0
else
echo -e "${RED}❌ FAIL${NC} - Unexpected response"
echo " Expected: $expected_pattern"
echo " Got: $response"
((FAILED++))
return 1
fi
else
echo -e "${RED}❌ FAIL${NC} - No response"
((FAILED++))
return 1
fi
}
# Function to test port availability
test_port() {
local port="$1"
local name="$2"
echo -n "Testing port $port ($name)... "
if sudo netstat -tlnp 2>/dev/null | grep -q ":$port "; then
echo -e "${GREEN}✅ PASS${NC}"
((PASSED++))
return 0
else
echo -e "${RED}❌ FAIL${NC} - Port not listening"
((FAILED++))
return 1
fi
}
echo "🔍 Core Services Testing"
echo "====================="
# Test Core Services
test_service "Coordinator API (8000)" "http://localhost:8000/v1/health" '"status":"ok"'
test_service "Exchange API (8001)" "http://localhost:8001/" '"detail"'
test_service "Blockchain RPC (8003)" "http://localhost:8003/rpc/head" '"height"'
echo ""
echo "🚀 Enhanced Services Testing"
echo "=========================="
# Test Enhanced Services
test_service "Multimodal GPU (8010)" "http://localhost:8010/health" '"service":"gpu-multimodal"'
test_service "GPU Multimodal (8011)" "http://localhost:8011/health" '"service":"gpu-multimodal"'
test_service "Modality Optimization (8012)" "http://localhost:8012/health" '"service":"modality-optimization"'
test_service "Adaptive Learning (8013)" "http://localhost:8013/health" '"service":"adaptive-learning"'
test_service "Web UI (8016)" "http://localhost:8016/health" '"service":"web-ui"'
echo ""
echo "🔧 Service Features Testing"
echo "========================="
# Test Service Features
test_service "GPU Status (8010)" "http://localhost:8010/gpu/status" '"gpu_available"'
test_service "GPU Multimodal Features (8011)" "http://localhost:8011/gpu/multimodal" '"multimodal_capabilities"'
test_service "Modality Optimization (8012)" "http://localhost:8012/optimization/modality" '"optimization_active"'
test_service "Learning Status (8013)" "http://localhost:8013/learning/status" '"learning_active"'
echo ""
echo "🌐 Port Availability Testing"
echo "=========================="
# Test Port Availability
test_port "8000" "Coordinator API"
test_port "8001" "Exchange API"
test_port "8003" "Blockchain RPC"
test_port "8010" "Multimodal GPU"
test_port "8011" "GPU Multimodal"
test_port "8012" "Modality Optimization"
test_port "8013" "Adaptive Learning"
test_port "8016" "Web UI"
echo ""
echo "📊 Test Results Summary"
echo "===================="
TOTAL=$((PASSED + FAILED))
echo "Total Tests: $TOTAL"
echo -e "Passed: ${GREEN}$PASSED${NC}"
echo -e "Failed: ${RED}$FAILED${NC}"
if [ $FAILED -eq 0 ]; then
echo -e "${GREEN}🎉 All tests passed!${NC}"
echo "✅ AITBC services are fully operational with new port logic"
exit 0
else
echo -e "${RED}❌ Some tests failed!${NC}"
echo "⚠️ Please check the failed services above"
exit 1
fi