headscale/hscontrol/policy/v2/testdata
Kristoffer Dalby 078b9e308f policy/v2: SaaS-derived compat tests for nodeAttrs
Adds a data-driven test that loads testdata/nodeattrs_results/*.hujson
and diffs the captured SaaS-rendered netmaps against headscale's
compileNodeAttrs output. Each capture is one scenario the SaaS
control plane has rendered against the same policy headscale is asked
to compile -- the test enforces shape parity per node.

tailnet_state_caps.go enumerates the caps SaaS emits where headscale
has no equivalent concept yet (user-role admin/owner, tailnet lock,
services host, app connectors, internal magicsock and SSH tuning,
tailnet-state metadata) plus the always-on baseline (admin, ssh,
file-sharing) and the taildrive pair. stripUnmodelledTailnetStateCaps
filters both sides of cmp.Diff so the comparison focuses on the
policy-driven caps. PeerCapMap encodes which caps the Tailscale
client reads from the peer view (suggest-exit-node when exit routes
are approved, etc.) for use by the mapper.

testcapture switches to typed tailcfg/netmap/filtertype/apitype
values so schema drift between the capture tool and headscale
becomes a compile error rather than a silent test failure. Existing
compat suites (acl, grants, routes, ssh, issue_3212) move to the
typed shape.

The 53 SelfNode netmap captures and the 7 anonymizer-corrupted
suggest-charmander -> suggest-exit-node restorations in
routes_results / issue_3212 ride along.
2026-05-13 14:22:30 +02:00
..
acl_results testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
grant_results testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
issue_3212 policy/v2: SaaS-derived compat tests for nodeAttrs 2026-05-13 14:22:30 +02:00
nodeattrs_results policy/v2: SaaS-derived compat tests for nodeAttrs 2026-05-13 14:22:30 +02:00
policytest_results policy/v2: add policytester captures recorded from Tailscale SaaS 2026-05-12 11:54:54 +01:00
routes_results policy/v2: SaaS-derived compat tests for nodeAttrs 2026-05-13 14:22:30 +02:00
ssh_results testdata: drop unused uppercase SSH-*.hujson fixtures 2026-05-05 11:59:01 +01:00