Files
cc-ci/tests/mumble/functional/test_server_config_limits.py
autonomic-bot 6841048aae feat(2): Q4.2 mumble — parity port (health/protocol-handshake/web) + 2 specific + P4 sqlite
- functional/_mumble_proto.py: stdlib Mumble TLS protocol client (adapted from corpus mumble_connect.py)
- 3 parity ports: test_tcp_health, test_protocol_handshake (channel presence+ServerSync), test_web_client
- 2 NEW recipe-specific (P3): welcome-text + max-users config round-trips over the protocol
- P4: ops.py + test_backup/test_restore seed ci_marker in /data/mumble-server.sqlite (recipe's own backupbot DB), busy_timeout for live-server locks
- test_install overlay: voice server listening on 64738 (beyond web-sidecar readiness)
- recipe_meta: COMPOSE_FILE=compose.yml:mumbleweb:host-ports; WELCOME_TEXT/USERS markers
- PARITY.md mapping table

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-29 19:20:56 +01:00

38 lines
1.8 KiB
Python

"""mumble — recipe-specific functional test #2 (Phase 2 P3, beyond parity).
Server-limit config round-trip via the ServerConfig protocol message. The harness deploys with a
distinctive USERS value (recipe_meta.EXTRA_ENV -> MUMBLE_CONFIG_USERS, the server's max-users cap,
set to a non-default 42). A client that completes the handshake receives a ServerConfig message
carrying the server's enforced limits (max_users, allow_html, message_length, ...). Asserting
max_users == our configured value proves the recipe wires deploy-time limits into the running
server and enforces them — a distinctive, characteristic mumble behaviour (server capacity policy),
not health-only. Version-independent (asserts OUR configured value).
"""
from __future__ import annotations
import os
import sys
sys.path.insert(0, os.path.dirname(__file__))
sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
import _mumble_proto # noqa: E402
import recipe_meta # noqa: E402
def test_configured_max_users_surfaces_in_serverconfig(live_app):
r = _mumble_proto.retry_handshake(attempts=12, interval=5.0)
assert r["server_sync"], f"ServerSync handshake did not complete — {r.get('error')}"
cfg = r["server_config"]
assert cfg, f"server did not send a ServerConfig message — {r!r}"
assert cfg.get("max_users") == recipe_meta.MAX_USERS, (
f"ServerConfig.max_users={cfg.get('max_users')!r} does not match the configured "
f"USERS={recipe_meta.MAX_USERS} — deploy-time server-limit config did not propagate"
)
# allow_html defaults true in the recipe; assert it is present/boolean to prove the field set
# is the real ServerConfig (not an empty/garbled decode).
assert cfg.get("allow_html") in (0, 1), (
f"ServerConfig.allow_html unexpected: {cfg.get('allow_html')!r}"
)