diff --git a/tests/integration/apache/platform/entrypoint.sh b/tests/integration/apache/platform/entrypoint.sh index 03165eb..4151780 100644 --- a/tests/integration/apache/platform/entrypoint.sh +++ b/tests/integration/apache/platform/entrypoint.sh @@ -13,6 +13,19 @@ fi # Créer les répertoires de run nécessaires mkdir -p /run/httpd /var/log/httpd +# Attendre que ClickHouse soit prêt (connection refused possible sinon) +echo "[entrypoint] Attente de ClickHouse (max 30s)…" +for i in $(seq 1 30); do + if curl -sf http://clickhouse:8123/ping >/dev/null 2>&1; then + echo "[entrypoint] ClickHouse est prêt (http://clickhouse:8123/ping OK)" + break + fi + if [ $i -eq 30 ]; then + echo "[entrypoint] ⚠ ClickHouse toujours pas prêt après 30s, démarrage ja4ebpf quand même" + fi + sleep 1 +done + # Démarrer ja4ebpf en arrière-plan (optionnel : ne bloque pas le démarrage) /usr/local/bin/ja4ebpf -config /etc/ja4ebpf/config.yml & JA4_PID=$! diff --git a/tests/integration/hitch-varnish/platform/entrypoint.sh b/tests/integration/hitch-varnish/platform/entrypoint.sh index 8e0707d..4172d38 100755 --- a/tests/integration/hitch-varnish/platform/entrypoint.sh +++ b/tests/integration/hitch-varnish/platform/entrypoint.sh @@ -101,6 +101,20 @@ with socketserver.TCPServer(('0.0.0.0',80), H) as s: s.serve_forever() " & + +# Attendre que ClickHouse soit prêt (connection refused possible sinon) +log "Attente de ClickHouse (max 30s)…" +for i in $(seq 1 30); do + if curl -sf http://clickhouse:8123/ping >/dev/null 2>&1; then + log "ClickHouse est prêt (http://clickhouse:8123/ping OK)" + break + fi + if [ $i -eq 30 ]; then + log "⚠ ClickHouse toujours pas prêt après 30s, démarrage ja4ebpf quand même" + fi + sleep 1 +done + # ── 4. Démarrage de ja4ebpf ─────────────────────────────────────────────────── log "Démarrage de ja4ebpf (uprobes hitch/libssl + hook TC eth0)…" ja4ebpf -config /etc/ja4ebpf/config.yml & diff --git a/tests/integration/nginx-varnish/platform/entrypoint.sh b/tests/integration/nginx-varnish/platform/entrypoint.sh index 4127099..babf4e0 100755 --- a/tests/integration/nginx-varnish/platform/entrypoint.sh +++ b/tests/integration/nginx-varnish/platform/entrypoint.sh @@ -80,6 +80,19 @@ for i in $(seq 1 20); do done # ── 4. Démarrage de ja4ebpf ─────────────────────────────────────────────────── +# Attendre que ClickHouse soit prêt (connection refused possible sinon) +log "Attente de ClickHouse (max 30s)…" +for i in $(seq 1 30); do + if curl -sf http://clickhouse:8123/ping >/dev/null 2>&1; then + log "ClickHouse est prêt (http://clickhouse:8123/ping OK)" + break + fi + if [ $i -eq 30 ]; then + log "⚠ ClickHouse toujours pas prêt après 30s, démarrage ja4ebpf quand même" + fi + sleep 1 +done + log "Démarrage de ja4ebpf (uprobes nginx/libssl + hook TC)…" ja4ebpf -config /etc/ja4ebpf/config.yml & JA4EBPF_PID=$! diff --git a/tests/integration/nginx/platform/entrypoint.sh b/tests/integration/nginx/platform/entrypoint.sh index 0c78c7b..ef82e30 100755 --- a/tests/integration/nginx/platform/entrypoint.sh +++ b/tests/integration/nginx/platform/entrypoint.sh @@ -33,6 +33,19 @@ for i in $(seq 1 20); do done # ── 2. Démarrage de ja4ebpf ─────────────────────────────────────────────── +# Attendre que ClickHouse soit prêt (connection refused possible sinon) +log "Attente de ClickHouse (max 30s)…" +for i in $(seq 1 30); do + if curl -sf http://clickhouse:8123/ping >/dev/null 2>&1; then + log "ClickHouse est prêt (http://clickhouse:8123/ping OK)" + break + fi + if [ $i -eq 30 ]; then + log "⚠ ClickHouse toujours pas prêt après 30s, démarrage ja4ebpf quand même" + fi + sleep 1 +done + log "Démarrage de ja4ebpf (attache uprobes sur libssl)…" ja4ebpf -config /etc/ja4ebpf/config.yml & JA4EBPF_PID=$!