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.
39 lines
1.0 KiB
Bash
Executable File
39 lines
1.0 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
cd "$(dirname "$0")"
|
|
|
|
cleanup() {
|
|
echo "=== Tearing down test environment ==="
|
|
docker compose -f docker-compose.test.yml down -v --remove-orphans 2>/dev/null
|
|
}
|
|
trap cleanup EXIT
|
|
|
|
echo "=== Generating configs from topology.py ==="
|
|
python3 generate_configs.py
|
|
|
|
echo "=== Building and starting reflector mesh ==="
|
|
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
|