4NK_node/sdk_relay/test_final.sh

70 lines
2.3 KiB
Bash
Executable File

#!/bin/bash
# Script de test final pour sdk_relay
set -e
echo "🔍 Test final de sdk_relay..."
echo ""
# Test 1: Vérifier que tous les services sont prêts
echo "📡 Test 1: Services prêts"
if sudo docker-compose ps | grep -q "bitcoin-signet.*Up"; then
echo "✅ Bitcoin Core en cours d'exécution"
else
echo "❌ Bitcoin Core non démarré"
exit 1
fi
if sudo docker-compose ps | grep -q "blindbit-oracle.*Up"; then
echo "✅ Blindbit en cours d'exécution"
else
echo "❌ Blindbit non démarré"
exit 1
fi
# Test 2: Vérifier la résolution DNS depuis sdk_relay
echo ""
echo "📡 Test 2: Résolution DNS depuis sdk_relay"
if sudo docker run --rm --network 4nk_node_btcnet lecoffre_node_sdk_relay getent hosts bitcoin 2>/dev/null | grep -q "bitcoin"; then
echo "✅ Résolution DNS 'bitcoin' OK"
else
echo "❌ Résolution DNS 'bitcoin' échoue"
exit 1
fi
if sudo docker run --rm --network 4nk_node_btcnet lecoffre_node_sdk_relay getent hosts blindbit 2>/dev/null | grep -q "blindbit"; then
echo "✅ Résolution DNS 'blindbit' OK"
else
echo "❌ Résolution DNS 'blindbit' échoue"
exit 1
fi
# Test 3: Vérifier la connectivité depuis sdk_relay
echo ""
echo "📡 Test 3: Connectivité depuis sdk_relay"
if sudo docker run --rm --network 4nk_node_btcnet lecoffre_node_sdk_relay sh -c "curl -s -f http://bitcoin:18443 >/dev/null" 2>/dev/null; then
echo "✅ Bitcoin Core accessible depuis sdk_relay"
else
echo "❌ Bitcoin Core inaccessible depuis sdk_relay"
exit 1
fi
if sudo docker run --rm --network 4nk_node_btcnet lecoffre_node_sdk_relay sh -c "curl -s -f http://blindbit:8000 >/dev/null" 2>/dev/null; then
echo "✅ Blindbit accessible depuis sdk_relay"
else
echo "❌ Blindbit inaccessible depuis sdk_relay"
exit 1
fi
# Test 4: Vérifier la configuration dans le container sdk_relay
echo ""
echo "📡 Test 4: Configuration dans sdk_relay"
echo "Configuration .conf.docker:"
sudo docker run --rm --network 4nk_node_btcnet lecoffre_node_sdk_relay cat /home/bitcoin/.conf.docker 2>/dev/null || echo "❌ Impossible de lire .conf.docker"
echo ""
echo "🎯 Tous les tests sont passés ! sdk_relay peut maintenant démarrer."
echo ""
echo "💡 Pour démarrer sdk_relay:"
echo " sudo docker-compose up -d sdk_relay"