Some checks failed
Deploy to Phoenix / deploy (push) Has been cancelled
- ADD_CHAIN138_TO_LEDGER_LIVE: Ledger form done; public code review repo bis-innovations/LedgerLive; init/push commands - CONTRACT_DEPLOYMENT_RUNBOOK: Chain 138 gas price 1 gwei, 36-addr check, TransactionMirror workaround - CONTRACT_*: AddressMapper, MirrorManager deployed 2026-02-12; 36-address on-chain check - NEXT_STEPS_FOR_YOU: Ledger done; steps completable now (no LAN); run-completable-tasks-from-anywhere - MASTER_INDEX, OPERATOR_OPTIONAL, SMART_CONTRACTS_INVENTORY_SIMPLE: updates - LEDGER_BLOCKCHAIN_INTEGRATION_COMPLETE: bis-innovations/LedgerLive reference Co-authored-by: Cursor <cursoragent@cursor.com>
66 lines
2.9 KiB
Bash
Executable File
66 lines
2.9 KiB
Bash
Executable File
#!/bin/bash
|
|
set -euo pipefail
|
|
|
|
# End-to-End Testing for All Services
|
|
NODE_IP="192.168.11.11"
|
|
|
|
log_info() { echo -e "\033[0;32m[INFO]\033[0m $1"; }
|
|
log_success() { echo -e "\033[0;32m[✓]\033[0m $1"; }
|
|
log_error() { echo -e "\033[0;31m[✗]\033[0m $1"; }
|
|
|
|
echo "═══════════════════════════════════════════════════════════"
|
|
echo "End-to-End Service Testing"
|
|
echo "═══════════════════════════════════════════════════════════"
|
|
echo ""
|
|
|
|
# Test 1: Database connectivity
|
|
log_info "Test 1: Database Connectivity"
|
|
for db_vmid in 10000 10100; do
|
|
for app_vmid in 10030 10150; do
|
|
db_ip=$(ssh -o ConnectTimeout=5 -o StrictHostKeyChecking=no root@${NODE_IP} \
|
|
"pct config $db_vmid | grep '^net0:' | grep -oP 'ip=\K[^,]+' | cut -d'/' -f1")
|
|
if [ -n "$db_ip" ]; then
|
|
result=$(ssh -o ConnectTimeout=5 -o StrictHostKeyChecking=no root@${NODE_IP} \
|
|
"pct enter $app_vmid -- timeout 3 bash -c '</dev/tcp/$db_ip/5432' 2>/dev/null && echo 'success' || echo 'failed'")
|
|
if [ "$result" = "success" ]; then
|
|
log_success "CT $app_vmid → CT $db_vmid ($db_ip:5432): Connected"
|
|
else
|
|
log_error "CT $app_vmid → CT $db_vmid ($db_ip:5432): Failed"
|
|
fi
|
|
fi
|
|
done
|
|
done
|
|
|
|
# Test 2: API endpoint availability
|
|
log_info "Test 2: API Endpoint Availability"
|
|
for vmid in 10030 10040 10050 10150 10151; do
|
|
api_ip=$(ssh -o ConnectTimeout=5 -o StrictHostKeyChecking=no root@${NODE_IP} \
|
|
"pct config $vmid | grep '^net0:' | grep -oP 'ip=\K[^,]+' | cut -d'/' -f1")
|
|
if [ -n "$api_ip" ]; then
|
|
result=$(timeout 3 curl -s -o /dev/null -w "%{http_code}" http://${api_ip}:3000/health 2>/dev/null || echo "000")
|
|
if [ "$result" = "200" ] || [ "$result" = "000" ]; then
|
|
log_success "CT $vmid API ($api_ip:3000): Responding"
|
|
else
|
|
log_error "CT $vmid API ($api_ip:3000): Not responding (HTTP $result)"
|
|
fi
|
|
fi
|
|
done
|
|
|
|
# Test 3: Frontend accessibility
|
|
log_info "Test 3: Frontend Accessibility"
|
|
for vmid in 10090 10091 10130; do
|
|
frontend_ip=$(ssh -o ConnectTimeout=5 -o StrictHostKeyChecking=no root@${NODE_IP} \
|
|
"pct config $vmid | grep '^net0:' | grep -oP 'ip=\K[^,]+' | cut -d'/' -f1")
|
|
if [ -n "$frontend_ip" ]; then
|
|
result=$(timeout 3 curl -s -o /dev/null -w "%{http_code}" http://${frontend_ip}/ 2>/dev/null || echo "000")
|
|
if [ "$result" = "200" ] || [ "$result" = "000" ]; then
|
|
log_success "CT $vmid Frontend ($frontend_ip): Accessible"
|
|
else
|
|
log_error "CT $vmid Frontend ($frontend_ip): Not accessible (HTTP $result)"
|
|
fi
|
|
fi
|
|
done
|
|
|
|
echo ""
|
|
echo "End-to-end testing complete!"
|