Files
ja4-platform/tests/integration/run-all-stacks.sh
toto 3b047b680a fix(ja4ebpf): split bpf2go generate into Ja4Tc + Ja4Ssl, fix RPM systemd-rpm-macros
- Use two separate //go:generate directives (Ja4Tc for tc_capture.c, Ja4Ssl
  for uprobe_ssl.c) to avoid duplicate LICENSE symbol and multi-file clang issue
- Update loader.go to hold tcObjs/sslObjs separately with correct field names:
  UprobeSslSetFd, UprobeSslReadEntry, UretprobeSslReadExit,
  KprobeAccept4Entry, KretprobeAccept4Exit
- Add systemd-rpm-macros to all three RPM build stages (el8/el9/el10)
  so that %{_unitdir} macro resolves correctly
- RPMs now build successfully for el8, el9, el10

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-11 23:21:11 +02:00

84 lines
2.8 KiB
Bash
Executable File

#!/usr/bin/env bash
# =============================================================================
# run-all-stacks.sh — Lance les tests des 3 stacks web en séquence
#
# Usage :
# ./run-all-stacks.sh # toutes les stacks
# ./run-all-stacks.sh nginx # stack nginx uniquement
# ./run-all-stacks.sh nginx-varnish hitch-varnish # 2 stacks
# ./run-all-stacks.sh --no-down # garder les stacks actives
# =============================================================================
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
RED='\033[0;31m'; GREEN='\033[0;32m'; YELLOW='\033[1;33m'; CYAN='\033[0;36m'; NC='\033[0m'
log() { echo -e "${CYAN}[run-all]${NC} $(date +%H:%M:%S) $*"; }
pass() { echo -e "${GREEN}$*${NC}"; }
fail() { echo -e "${RED}$*${NC}"; }
# Stacks disponibles
ALL_STACKS=(apache nginx nginx-varnish hitch-varnish)
STACKS_TO_RUN=()
EXTRA_ARGS=()
for arg in "$@"; do
case "$arg" in
apache|nginx|nginx-varnish|hitch-varnish)
STACKS_TO_RUN+=("$arg") ;;
*)
EXTRA_ARGS+=("$arg") ;;
esac
done
# Par défaut : toutes les stacks
[ "${#STACKS_TO_RUN[@]}" -eq 0 ] && STACKS_TO_RUN=("${ALL_STACKS[@]}")
declare -A RESULTS
for stack in "${STACKS_TO_RUN[@]}"; do
runner="$SCRIPT_DIR/$stack/run-tests.sh"
if [ ! -f "$runner" ]; then
log "ERREUR : runner introuvable pour la stack '$stack' ($runner)"
RESULTS[$stack]="MISSING"
continue
fi
chmod +x "$runner"
log "========================================================"
log "Démarrage de la stack : $stack"
log "========================================================"
if bash "$runner" "${EXTRA_ARGS[@]}"; then
RESULTS[$stack]="PASS"
pass "Stack $stack : TOUS LES TESTS RÉUSSIS"
else
RESULTS[$stack]="FAIL"
fail "Stack $stack : DES TESTS ONT ÉCHOUÉ"
fi
echo ""
done
# ── Résumé global ─────────────────────────────────────────────────────────────
log "========================================================"
log "RÉSUMÉ GLOBAL"
log "========================================================"
TOTAL_PASS=0
TOTAL_FAIL=0
for stack in "${STACKS_TO_RUN[@]}"; do
result="${RESULTS[$stack]:-MISSING}"
case "$result" in
PASS) pass "[$stack] RÉUSSI" ; TOTAL_PASS=$((TOTAL_PASS + 1)) ;;
FAIL) fail "[$stack] ÉCHOUÉ" ; TOTAL_FAIL=$((TOTAL_FAIL + 1)) ;;
MISSING) echo -e "${YELLOW} ⚠ [$stack] MANQUANT${NC}" ; TOTAL_FAIL=$((TOTAL_FAIL + 1)) ;;
esac
done
echo ""
log "Total : ${TOTAL_PASS} réussi(s), ${TOTAL_FAIL} échoué(s) sur ${#STACKS_TO_RUN[@]} stacks"
[ "$TOTAL_FAIL" -gt 0 ] && exit 1 || exit 0