headscale/hscontrol/policy/v2/testdata/routes_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
..
routes-a1-wildcard-acl-includes-routes-in-srcips.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-a2-tag-based-acl-excludes-routes.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-a3-explicit-subnet-filter-to-router.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-a3b-autogroup-member-to-subnet.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-a4-multiple-routes-same-router.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-a5-host-alias-to-subnet.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-b1-exit-routes-not-in-srcips.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-b2-tag-exit-excludes-exit-routes.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-b3-exit-node-advertises-routes.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-b4-multi-router-has-both-route-types.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-b5-exit-with-wildcard-dst.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-b6-exit-node-option-field.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-b7-multiple-exit-nodes.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-b8-autogroup-internet-no-filters.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-b9-exit-routes-in-allowedips.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-b10-exit-routes-not-in-primaryroutes.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-b11-autogroup-internet-only.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-b12-connectivity-plus-autogroup-internet.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-b13-connectivity-plus-explicit-exit.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-b14-all-three-internet-patterns.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-b15-restricted-src-autogroup-internet.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-b16-autogroup-internet-no-exit-approval.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-d1-basic-route-auto-approval.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-d2-nested-prefix-approval.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-d3-exact-prefix-approval.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-d4-prefix-not-covered.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-d5-wrong-tag-not-approved.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-d6-exit-node-auto-approval.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-d7-exit-auto-approval-wrong-tag.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-d8-auto-approval-acl-interaction.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-d9-auto-approval-triggers-on-advertise.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-d10-auto-approval-retroactive.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-d11-overlapping-auto-approvers.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-e1-ha-two-routers-same-subnet.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-e2-ha-primary-in-allowedips.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-e3-ha-secondary-no-route-in-allowedips.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-e4-ha-both-get-filters-host-alias.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-e5-first-advertiser-is-primary.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-ea1-exitnode-field-basic.hujson policy/v2: SaaS-derived compat tests for nodeAttrs 2026-05-13 14:22:30 +02:00
routes-ea2-exitnode-field-wrong-tag.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-ea3-exitnode-field-dual-node.hujson policy/v2: SaaS-derived compat tests for nodeAttrs 2026-05-13 14:22:30 +02:00
routes-ea4-exitnode-plus-routes-dual-node.hujson policy/v2: SaaS-derived compat tests for nodeAttrs 2026-05-13 14:22:30 +02:00
routes-ea5-exitnode-field-not-advertising.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-ea6-routes-map-exit-basic.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-ea7-routes-map-exit-wrong-tag.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-ea8-routes-map-exit-plus-subnet.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-ea9-routes-map-exit-not-advertising.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-ea10-routes-map-subnet-only-node.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-ea11-both-fields-same-tag.hujson policy/v2: SaaS-derived compat tests for nodeAttrs 2026-05-13 14:22:30 +02:00
routes-ea12-both-fields-routes-matches.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-ea13-both-fields-exitnode-matches.hujson policy/v2: SaaS-derived compat tests for nodeAttrs 2026-05-13 14:22:30 +02:00
routes-ea14-no-autoapprover.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-ea15-subnet-only-autoapprover.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-f1-filter-on-destination-not-source.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-f2-subnet-as-acl-source.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-f3-wildcard-src-specific-dst.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-f4-specific-src-wildcard-dst.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-f5-bidirectional-subnet-access.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-f6-filter-srcips-expansion.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-f7-filter-dstports-shows-acl-cidr.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-f8-route-enabled-acl-denies.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-f9-route-disabled-acl-allows.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-f10-subnet-to-subnet-issue3157.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-f11-subnet-to-subnet-bidirectional.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-f12-subnet-to-subnet-host-aliases.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-f13-subnet-to-subnet-disjoint.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-f14-subnet-to-subnet-overlapping-one-router.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-f15-subnet-to-subnet-cross-routers.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-f16-subnet-to-subnet-cidr-only-no-wildcard.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-f18-subnet-to-subnet-tag-acl.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-g1-port-restriction-subnet.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-g2-port-range-subnet.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-g3-multiple-ports-subnet.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-g4-protocol-icmp-subnet.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-g5-protocol-tcp-only.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-g6-protocol-udp-only.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-g7-all-ports-wildcard.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-g8-default-ipproto.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-h1-wildcard-srcips-format.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-h2-wildcard-dstports-format.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-h3-cgnat-range-expansion.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-h4-ipv6-range-in-srcips.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-h5-subnet-overlaps-cgnat.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-h6-loopback-routes-not-distributed.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-h7-two-nodes-same-subnet.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-h8-cgnat-overlap-blocked.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-h9-large-prefix-works.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-h10-very-small-prefix.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-h11-ipv6-small-prefix.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-i1-ipv6-subnet-route.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-i2-ipv6-exit-route.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-i3-ipv6-in-wildcard-srcips.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-i4-ipv6-specific-acl.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-i5-ipv6-parent-child-routes.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-i6-dual-stack-node.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-i7-ipv6-exit-coverage.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-i8-ipv6-subnet-route-wildcard.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-i9-ipv6-subnet-targeted-acl.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-o1-overlapping-routes-not-merged.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-o2-ha-routers-both-get-filter.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-o3-parent-child-different-nodes.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-o4-three-way-hierarchy.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-o5-sibling-routes-with-parent-acl.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-o6-exit-route-expands-filter-dist.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-o7-specific-ip-targeting.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-o8-same-node-overlapping-routes.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-o9-different-nodes-same-route.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-o10-acl-dest-covered-by-multiple.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-o11-acl-dest-not-covered.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-o12-filter-dest-is-acl-cidr.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-pa1-partial-route-approval.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-pa2-partial-approval-restricted-acl.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-r1-exit-covers-external-dest.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-r2-parent-route-covers-child-dest.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-r3-sibling-routes-no-coverage.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-r4-exact-match-route.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-r5-route-coverage-check-logic.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-r6-ipv6-route-coverage.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-r7-exit-ipv6-coverage.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-r8-mixed-ipv4-ipv6-coverage.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-t1-tags-resolve-to-ips-not-routes.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-t2-tag-to-tag-with-exit.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-t3-tag-src-includes-all-tagged.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-t4-tag-dst-includes-all-tagged.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00
routes-t5-multi-tag-node-in-both.hujson testdata: add SaaS captures for compat tests 2026-04-17 16:31:49 +01:00