tests: integration tests for TWIN handshake, mirror, failover

Adds tests/test_twin.py with 7 tests covering the TWIN topology:
  1–2. Twin handshake presence and absence of auth errors on ref1/ref2
  3–4. PAIRED=1 trunk (refA↔DE pair) reported connected on all three sides
  5.   Twin wiring smoke test (no ERROR[TWIN], server-listen log present)
  6.   Twin disconnect/recovery: kill ref2, verify ref1 detects timeout,
       verify re-handshake after restart
  7.   PAIRED trunk failover: kill ref1, verify refA still routes via ref2

run_tests.sh extended to tear down the default mesh, regenerate configs
with --topology twin, run test_twin.py, then restore the default topology.
This commit is contained in:
Audric committed 2026-04-15 22:28:42 +02:00
1 parent 9cfea32da6
commit 9acb765110
2 files changed
+547

No files matched your search

+20
View File
@@ -16,3 +16,23 @@ docker compose -f docker-compose.test.yml up -d --build --wait
echo "=== Running integration tests ==="
python3 test_trunk.py
echo ""
echo "=================================="
echo "Running TWIN protocol tests"
echo "=================================="
echo "=== Generating TWIN topology configs ==="
python3 generate_configs.py --topology twin
echo "=== Tearing down default mesh ==="
docker compose -f docker-compose.test.yml down -v --remove-orphans
echo "=== Building and starting TWIN mesh ==="
docker compose -f docker-compose.test.yml up -d --build --wait
echo "=== Running TWIN integration tests ==="
python3 test_twin.py
echo "=== Restoring default topology ==="
python3 generate_configs.py