mapper: test that a hidden peer's policy change still sends filters

This commit is contained in:
Kristoffer Dalby committed 2026-11-02 17:46:53 +00:00
1 parent 077dd5b11d
commit 0fa4b93b09
1 file changed
+14
+14
View File
@@ -503,6 +503,20 @@ func TestBuildFromChangeFiltersUserProfilesByVisibility(t *testing.T) {
assert.NotEqual(t, user2.TailscaleUserProfile().ID, up.ID,
"n1 must not receive user2's profile; n2 is not ACL-visible to n1")
}
// What else the change carries still reaches n1, without n2 or user2's
// profile.
c = change.PolicyAndPeers(n2.ID)
resp, err = m.buildFromChange(n1.ID, tailcfg.CurrentCapabilityVersion, &c)
require.NoError(t, err)
require.NotNil(t, resp)
assert.NotNil(t, resp.PacketFilters)
assert.Empty(t, resp.PeersChanged)
for _, up := range resp.UserProfiles {
assert.NotEqual(t, user2.TailscaleUserProfile().ID, up.ID,
"n1 must not receive user2's profile with the policy change")
}
}
// TestBuildFromChangeVisibilityMatchesFullMap is the consolidation guard for