headscale/hscontrol/policy/v2/testdata/nodeattrs_results
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
..
nodeattrs-attr-c1-funnel.hujson policy/v2: SaaS-derived compat tests for nodeAttrs 2026-05-13 14:22:30 +02:00
nodeattrs-attr-c2-randomize.hujson policy/v2: SaaS-derived compat tests for nodeAttrs 2026-05-13 14:22:30 +02:00
nodeattrs-attr-c3-captive.hujson policy/v2: SaaS-derived compat tests for nodeAttrs 2026-05-13 14:22:30 +02:00
nodeattrs-attr-c4-magicdns-aaaa.hujson policy/v2: SaaS-derived compat tests for nodeAttrs 2026-05-13 14:22:30 +02:00
nodeattrs-attr-c5-taildrive-share.hujson policy/v2: SaaS-derived compat tests for nodeAttrs 2026-05-13 14:22:30 +02:00
nodeattrs-attr-c6-taildrive-access-only.hujson policy/v2: SaaS-derived compat tests for nodeAttrs 2026-05-13 14:22:30 +02:00
nodeattrs-attr-c7-file-sharing.hujson policy/v2: SaaS-derived compat tests for nodeAttrs 2026-05-13 14:22:30 +02:00
nodeattrs-attr-c8-admin.hujson policy/v2: SaaS-derived compat tests for nodeAttrs 2026-05-13 14:22:30 +02:00
nodeattrs-attr-c9-ssh.hujson policy/v2: SaaS-derived compat tests for nodeAttrs 2026-05-13 14:22:30 +02:00
nodeattrs-attr-c10-disable-relay-server.hujson policy/v2: SaaS-derived compat tests for nodeAttrs 2026-05-13 14:22:30 +02:00
nodeattrs-attr-c11-unknown.hujson policy/v2: SaaS-derived compat tests for nodeAttrs 2026-05-13 14:22:30 +02:00
nodeattrs-attr-c12-cap-with-query.hujson policy/v2: SaaS-derived compat tests for nodeAttrs 2026-05-13 14:22:30 +02:00
nodeattrs-attr-c13-suggest-exit-node.hujson policy/v2: SaaS-derived compat tests for nodeAttrs 2026-05-13 14:22:30 +02:00
nodeattrs-attr-c14-suggest-exit-node-approved.hujson policy/v2: SaaS-derived compat tests for nodeAttrs 2026-05-13 14:22:30 +02:00
nodeattrs-error-e1-empty.hujson policy/v2: SaaS-derived compat tests for nodeAttrs 2026-05-13 14:22:30 +02:00
nodeattrs-error-e2-bad-target.hujson policy/v2: SaaS-derived compat tests for nodeAttrs 2026-05-13 14:22:30 +02:00
nodeattrs-error-e3-autogroup-self.hujson policy/v2: SaaS-derived compat tests for nodeAttrs 2026-05-13 14:22:30 +02:00
nodeattrs-error-e4-reserved-ippool.hujson policy/v2: SaaS-derived compat tests for nodeAttrs 2026-05-13 14:22:30 +02:00
nodeattrs-error-e5-empty-target-array.hujson policy/v2: SaaS-derived compat tests for nodeAttrs 2026-05-13 14:22:30 +02:00
nodeattrs-error-e6-tag-not-defined.hujson policy/v2: SaaS-derived compat tests for nodeAttrs 2026-05-13 14:22:30 +02:00
nodeattrs-error-e7-empty-nodeAttrs.hujson policy/v2: SaaS-derived compat tests for nodeAttrs 2026-05-13 14:22:30 +02:00
nodeattrs-funnel-f1-tag.hujson policy/v2: SaaS-derived compat tests for nodeAttrs 2026-05-13 14:22:30 +02:00
nodeattrs-funnel-f2-user.hujson policy/v2: SaaS-derived compat tests for nodeAttrs 2026-05-13 14:22:30 +02:00
nodeattrs-interaction-h1-with-acls.hujson policy/v2: SaaS-derived compat tests for nodeAttrs 2026-05-13 14:22:30 +02:00
nodeattrs-interaction-h2-with-grants.hujson policy/v2: SaaS-derived compat tests for nodeAttrs 2026-05-13 14:22:30 +02:00
nodeattrs-interaction-h3-policy-uses-everything.hujson policy/v2: SaaS-derived compat tests for nodeAttrs 2026-05-13 14:22:30 +02:00
nodeattrs-ippool-g1-admin.hujson policy/v2: SaaS-derived compat tests for nodeAttrs 2026-05-13 14:22:30 +02:00
nodeattrs-ippool-g2-group.hujson policy/v2: SaaS-derived compat tests for nodeAttrs 2026-05-13 14:22:30 +02:00
nodeattrs-ippool-g3-mixed.hujson policy/v2: SaaS-derived compat tests for nodeAttrs 2026-05-13 14:22:30 +02:00
nodeattrs-merge-b1-union.hujson policy/v2: SaaS-derived compat tests for nodeAttrs 2026-05-13 14:22:30 +02:00
nodeattrs-merge-b2-overlap.hujson policy/v2: SaaS-derived compat tests for nodeAttrs 2026-05-13 14:22:30 +02:00
nodeattrs-merge-b3-same-target-twice.hujson policy/v2: SaaS-derived compat tests for nodeAttrs 2026-05-13 14:22:30 +02:00
nodeattrs-merge-b4-duplicate-attr.hujson policy/v2: SaaS-derived compat tests for nodeAttrs 2026-05-13 14:22:30 +02:00
nodeattrs-merge-b5-multiple-nextdns.hujson policy/v2: SaaS-derived compat tests for nodeAttrs 2026-05-13 14:22:30 +02:00
nodeattrs-nextdns-d1-profile.hujson policy/v2: SaaS-derived compat tests for nodeAttrs 2026-05-13 14:22:30 +02:00
nodeattrs-nextdns-d2-no-device-info.hujson policy/v2: SaaS-derived compat tests for nodeAttrs 2026-05-13 14:22:30 +02:00
nodeattrs-nextdns-d3-per-tag.hujson policy/v2: SaaS-derived compat tests for nodeAttrs 2026-05-13 14:22:30 +02:00
nodeattrs-tailnet-devices-auto-updates-on.hujson policy/v2: SaaS-derived compat tests for nodeAttrs 2026-05-13 14:22:30 +02:00
nodeattrs-tailnet-magicdns-on.hujson policy/v2: SaaS-derived compat tests for nodeAttrs 2026-05-13 14:22:30 +02:00
nodeattrs-target-a1-wildcard.hujson policy/v2: SaaS-derived compat tests for nodeAttrs 2026-05-13 14:22:30 +02:00
nodeattrs-target-a2-user.hujson policy/v2: SaaS-derived compat tests for nodeAttrs 2026-05-13 14:22:30 +02:00
nodeattrs-target-a3-tag.hujson policy/v2: SaaS-derived compat tests for nodeAttrs 2026-05-13 14:22:30 +02:00
nodeattrs-target-a4-group.hujson policy/v2: SaaS-derived compat tests for nodeAttrs 2026-05-13 14:22:30 +02:00
nodeattrs-target-a5-autogroup-member.hujson policy/v2: SaaS-derived compat tests for nodeAttrs 2026-05-13 14:22:30 +02:00
nodeattrs-target-a6-autogroup-tagged.hujson policy/v2: SaaS-derived compat tests for nodeAttrs 2026-05-13 14:22:30 +02:00
nodeattrs-target-a7-mixed.hujson policy/v2: SaaS-derived compat tests for nodeAttrs 2026-05-13 14:22:30 +02:00
nodeattrs-target-a8-host.hujson policy/v2: SaaS-derived compat tests for nodeAttrs 2026-05-13 14:22:30 +02:00
nodeattrs-target-a9-prefix.hujson policy/v2: SaaS-derived compat tests for nodeAttrs 2026-05-13 14:22:30 +02:00
nodeattrs-target-a10-autogroup-admin.hujson policy/v2: SaaS-derived compat tests for nodeAttrs 2026-05-13 14:22:30 +02:00
nodeattrs-target-a11-autogroup-owner.hujson policy/v2: SaaS-derived compat tests for nodeAttrs 2026-05-13 14:22:30 +02:00
nodeattrs-target-a12-tag-vs-autogroup-member.hujson policy/v2: SaaS-derived compat tests for nodeAttrs 2026-05-13 14:22:30 +02:00
nodeattrs-toplevel-randomize-client-port.hujson policy/v2: SaaS-derived compat tests for nodeAttrs 2026-05-13 14:22:30 +02:00
nodeattrs-toplevel-randomize-plus-nodeattrs.hujson policy/v2: SaaS-derived compat tests for nodeAttrs 2026-05-13 14:22:30 +02:00