Files
GeuReflector/tests/topology_redis.py
T
Audric 363648ae43 Add Redis test harness and user add/disable integration tests
Parallel harness (topology_redis.py, generate_redis_configs.py,
docker-compose.redis.yml, run_redis_tests.sh) runs on port range 45xxx
without conflicting with the legacy test stack. test_redis.py adds two
integration tests: user add+auth and user disable rejection, both using
the existing ClientPeer V2 auth from test_trunk.py.
2026-04-15 11:03:09 +02:00

43 lines
1.2 KiB
Python

"""Minimal topology for Redis-backed test harness.
Edit here, then run `python3 generate_redis_configs.py` to regenerate
configs-redis/ and docker-compose.redis.yml.
"""
# Single Redis-enabled reflector for the Redis test suite.
REFLECTORS = {
"r1": {"prefix": ["1"], "trunk_port_base": 45000, "redis": True},
}
REDIS = {
"host": "redis",
"port": 6379,
}
# V2 test client credentials (populated into Redis by tests themselves).
TEST_CLIENTS = [
{"callsign": "N0TEST", "group": "TestGroup", "password": "testpass"},
{"callsign": "N0OTHER", "group": "OtherGroup", "password": "otherpass"},
]
# Internal container ports (same as legacy harness so the reflector
# binary's defaults don't change).
INTERNAL_CLIENT_PORT = 5300
INTERNAL_TRUNK_PORT = 5302
INTERNAL_HTTP_PORT = 8080
def service_name(name: str) -> str:
return f"reflector-{name}"
def mapped_client_port(name: str) -> int:
return REFLECTORS[name]["trunk_port_base"] + 300
def mapped_http_port(name: str) -> int:
return REFLECTORS[name]["trunk_port_base"] + 3080
def redis_port() -> int:
return 46379
def redis_db_index(name: str) -> int:
return sorted(REFLECTORS).index(name)