From 92f13cf677c9be11a098248c1d2ed08c08e4a4ff Mon Sep 17 00:00:00 2001 From: Patrick Schurig Date: Fri, 16 Oct 2026 19:54:25 +0200 Subject: [PATCH] =?UTF-8?q?test(decisions):=20r=C3=A9seau=20priv=C3=A9=20p?= =?UTF-8?q?ar=20processus=20(--unshare-net)=20dans=20run-decisions.sh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Deux agents testent désormais en parallèle sur la même machine ; le /tmp privé n'isolait pas les ports fixes du harnais (4847). Recommandation des rapports brief 4 T1/T2, déjà appliquée dans le script de preuve hors dépôt. Co-Authored-By: Claude Opus 5.5 --- tests/auto/decisions/run-decisions.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/auto/decisions/run-decisions.sh b/tests/auto/decisions/run-decisions.sh index da9bc95..9876b09 100755 --- a/tests/auto/decisions/run-decisions.sh +++ b/tests/auto/decisions/run-decisions.sh @@ -12,6 +12,11 @@ # AGENTS.md : UN PROCESSUS PAR TEST, chacun sous MemoryMax=2G. Les tests ne tournent jamais en # parallèle (le harnais nymea ouvre des ports fixes). Un test qui sort en erreur est rejoué UNE # fois — instabilité connue du port 4847 — et le rejeu est annoncé, jamais masqué. +# +# RÉSEAU PRIVÉ PAR PROCESSUS (`--unshare-net`). Les ports fixes du harnais sont la seule chose +# qu'un /tmp privé n'isole pas : depuis le 2026-10-16, deux agents testent en parallèle sur la +# même machine, et un 4847 tenu par l'un faisait échouer l'autre. Dans son propre espace réseau, +# chaque processus a sa boucle locale et ses ports — aucun test n'a besoin d'un autre réseau. set -u ICI="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" @@ -48,7 +53,7 @@ lancer() { # $1 = fonction, $2 = fichier NDJSON du test rm -f "$2" ( cd "$BIN_DIR" && ETM_DECISIONS_OUT="$2" ETM_DECISIONS_EPOCH="$EPOQUE" \ systemd-run --user --scope -q -p MemoryMax=2G -p MemorySwapMax=0 \ - bwrap --dev-bind / / --tmpfs /tmp --bind "$BUILD" "$BUILD" --bind "$TRAVAIL" "$TRAVAIL" \ + bwrap --dev-bind / / --unshare-net --tmpfs /tmp --bind "$BUILD" "$BUILD" --bind "$TRAVAIL" "$TRAVAIL" \ --chdir "$BIN_DIR" \ ./target_wrapper.sh ./nymea-energy-decisions "$1" > "$TRAVAIL/$1.log" 2>&1 ) }