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

This commit is contained in:
Kristoffer Dalby committed 2026-10-28 18:28:22 +00:00
1 parent 24e3a8d526
commit 50c4ed8f67
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