CalejoControl/scripts/test-mock-services.sh

51 lines
1.4 KiB
Bash
Raw Normal View History

#!/bin/bash
# Quick test for mock SCADA and optimizer services
set -e
echo "🧪 Testing Mock Services..."
echo ""
# Test Mock SCADA
echo "📊 Testing Mock SCADA..."
if curl -s http://localhost:8081/health | grep -q "healthy"; then
echo "✅ Mock SCADA is healthy"
# Get SCADA data
echo " Fetching SCADA data..."
curl -s http://localhost:8081/api/v1/data | jq '.data | keys' 2>/dev/null || echo " SCADA data available"
else
echo "❌ Mock SCADA is not responding"
fi
echo ""
# Test Mock Optimizer
echo "🧠 Testing Mock Optimizer..."
if curl -s http://localhost:8082/health | grep -q "healthy"; then
echo "✅ Mock Optimizer is healthy"
# Get available models
echo " Fetching optimization models..."
curl -s http://localhost:8082/api/v1/models | jq '.models | keys' 2>/dev/null || echo " Optimization models available"
else
echo "❌ Mock Optimizer is not responding"
fi
echo ""
# Test Calejo Control Adapter
echo "🌐 Testing Calejo Control Adapter..."
if curl -s http://localhost:8080/health | grep -q "healthy"; then
echo "✅ Calejo Control Adapter is healthy"
# Test dashboard
echo " Testing dashboard access..."
curl -s -I http://localhost:8080/dashboard | head -1 | grep -q "200" && echo " Dashboard accessible" || echo " Dashboard status check"
else
echo "❌ Calejo Control Adapter is not responding"
fi
echo ""
echo "✅ Mock services test completed!"