#!/bin/bash # System-Test-Script echo "🧪 Pfandsystem Test-Suite" echo "==========================" echo "" # 1. Container-Status echo "1️⃣ Container-Status:" docker-compose ps echo "" # 2. Backend Health Check echo "2️⃣ Backend Health Check:" curl -s http://localhost:3001/health || echo "❌ Backend nicht erreichbar" echo "" echo "" # 3. MySQL-Verbindung echo "3️⃣ MySQL-Verbindung:" docker exec pfandsystem-mysql mysql -u pfandsystem -ppfandsystem_secure_password -e "SELECT 'MySQL OK' as status;" 2>/dev/null || echo "❌ MySQL nicht erreichbar" echo "" # 4. Backend-Logs (letzte 10 Zeilen) echo "4️⃣ Backend-Logs (letzte 10 Zeilen):" docker-compose logs --tail=10 backend echo "" # 5. Frontend erreichbar echo "5️⃣ Frontend Check:" curl -s -o /dev/null -w "HTTP Status: %{http_code}\n" http://localhost:80 echo "" # 6. API-Endpunkte testen echo "6️⃣ API-Endpunkte:" echo " /api/auth/login:" curl -s -o /dev/null -w " HTTP Status: %{http_code}\n" -X POST http://localhost:3001/api/auth/login \ -H "Content-Type: application/json" \ -d '{"email":"test","password":"test"}' echo "" echo "✅ Test abgeschlossen"