#79 — iperf3-test-auto
PLANIFIÉ
Priorité: 🟠 HAUTE · Type: TYPE G · Conteneur: rgz-tools · Code: tools/iperf3_auto/
Dépendances: Aucune
Description
Outil de validation automatique des débits réseau via iperf3. Vérifie que chaque lien CPE atteint les seuils minimaux contractuels : DL > 5 Mbps, UL > 1 Mbps, latence < 100 ms. Utilisé lors de l'onboarding revendeur (étape 5, outil #56) et en maintenance périodique.
Conçu pour être exécuté depuis le NOC vers un serveur iperf3 hébergé sur chaque site, ou depuis le terrain via le CPE alignment tool (#67). Génère un rapport JSON structuré intégrable dans l'API RGZ.
Peut être déclenché manuellement par un technicien ou automatiquement par le workflow d'onboarding.
Architecture Interne
python3 iperf3_auto.py --server 10.142.0.1 --duration 30
↓
Test Download (serveur → client, -R flag):
iperf3 -c 10.142.0.1 -t 30 -R -J
↓
Test Upload (client → serveur):
iperf3 -c 10.142.0.1 -t 30 -J
↓
Test latence ICMP:
ping -c 20 10.142.0.1
↓
Rapport JSON:
{
"dl_mbps": 18.5,
"ul_mbps": 6.2,
"latency_ms": 12.4,
"jitter_ms": 0.8,
"packet_loss_percent": 0.0,
"result": "pass",
"thresholds": {"dl": 5, "ul": 1, "latency": 100},
"timestamp": "2026-02-21T10:30:00Z"
}Seuils de validation
| Métrique | Seuil minimum | Résultat si dessous |
|---|---|---|
| Download | 5 Mbps | FAIL |
| Upload | 1 Mbps | FAIL |
| Latence | 100 ms | WARN |
| Packet loss | 1 % | WARN |
| Jitter | 10 ms | WARN |
Configuration
env
IPERF3_SERVER=10.0.0.1 # Serveur iperf3 NOC (ou IP site)
IPERF3_PORT=5201 # Port iperf3 (défaut: 5201)
IPERF3_DURATION=30 # Durée test en secondes
MIN_DL_MBPS=5
MIN_UL_MBPS=1
MAX_LATENCY_MS=100
MAX_PACKET_LOSS_PERCENT=1
PING_COUNT=20Serveur iperf3 NOC
bash
# Lancer serveur iperf3 (sur le serveur NOC)
docker run -d --name iperf3-server \
--restart unless-stopped \
-p 5201:5201 \
networkstatic/iperf3 -s
# Ou via rgz-tools
docker exec rgz-tools iperf3 -s -DUtilisation CLI
bash
# Test simple
python3 tools/iperf3_auto/iperf3_auto.py --server 10.142.0.1
# Test avec durée personnalisée + rapport JSON
python3 tools/iperf3_auto/iperf3_auto.py \
--server 10.142.0.1 \
--duration 60 \
--output /tmp/test_$(date +%Y%m%d_%H%M).json
# Test batch (plusieurs serveurs)
python3 tools/iperf3_auto/iperf3_auto.py \
--servers 10.142.0.1,10.143.0.1,10.144.0.1 \
--output /tmp/batch_results.json
# Via API (onboarding #56)
curl -X POST -H "Authorization: Bearer $JWT" \
https://api-rgz.duckdns.org/api/v1/tools/iperf3 \
-d '{"server_ip": "10.142.0.1", "duration": 30}'Exemple de sortie
╔═══════════════════════════════════════╗
║ RGZ iperf3 Auto-Test v1.0 ║
║ Serveur: 10.142.0.1 ║
╠═══════════════════════════════════════╣
║ Download: 18.5 Mbps ✓ (min: 5) ║
║ Upload: 6.2 Mbps ✓ (min: 1) ║
║ Latence: 12.4 ms ✓ (max: 100) ║
║ Jitter: 0.8 ms ✓ ║
║ Pertes: 0.0 % ✓ ║
╠═══════════════════════════════════════╣
║ RÉSULTAT: ✅ PASS ║
╚═══════════════════════════════════════╝Implémentation TODO
- [ ] CLI
tools/iperf3_auto/iperf3_auto.py - [ ] Wrapper Python autour de
iperf3binaire (subprocess) - [ ] Test DL + UL + latence ICMP
- [ ] Rapport JSON structuré
- [ ] Mode batch multi-serveurs
- [ ] Intégration via endpoint API
/api/v1/tools/iperf3 - [ ] Docker image
rgz-toolsavec iperf3 installé - [ ] Serveur iperf3 NOC (container dédié)
Dernière mise à jour: 2026-02-21