mirror of https://github.com/tailscale/tailscale/
COMPREHENSIVE: debugderp_test.go 0→1,236 lines, 24 tests! 🌐
Complete testing for serveDebugDERPRegion (307-line handler with ZERO tests): • Permission checks (PermitWrite) • Method validation (POST requirement) • DERP map validation (nil map, empty map) • Region lookup (by ID and by code) • Region validation: - Non-existent regions (by ID/code) - Single region warning (single point of failure) - Multiple regions (no warning) - Avoid bit warning - Empty/nil nodes error • Node configuration: - STUN-only nodes - Multiple nodes per region - IPv4/IPv6 validation • Edge cases: - Empty/missing region parameter - Region ID 0, negative IDs, very large IDs - Special characters in region codes (us-west-2) - Case-sensitive region code matching • Response structure validation (JSON encoding) Session total: 9,188 lines → Target: 10,000 (812 to go!)pull/17963/head
parent
97708b7f45
commit
3fb14c9374