mirror of
https://github.com/tailscale/tailscale.git
synced 2025-12-05 12:22:04 +00:00
ipn/ipnlocal: account for ControlURL when merging profiles
We merge/dedupe profiles based on UserID and NodeID, however we were not accounting for ControlURLs. Updates #713 Signed-off-by: Maisem Ali <maisem@tailscale.com>
This commit is contained in:
@@ -131,15 +131,22 @@ func TestProfileList(t *testing.T) {
|
||||
if lp := pm.findProfileByName(carol.Name); lp != nil {
|
||||
t.Fatalf("found profile for user2 in user1's profile list")
|
||||
}
|
||||
if lp := pm.findProfilesByNodeID(carol.NodeID); lp != nil {
|
||||
if lp := pm.findProfilesByNodeID(carol.ControlURL, carol.NodeID); lp != nil {
|
||||
t.Fatalf("found profile for user2 in user1's profile list")
|
||||
}
|
||||
if lp := pm.findProfilesByUserID(carol.UserProfile.ID); lp != nil {
|
||||
if lp := pm.findProfilesByUserID(carol.ControlURL, carol.UserProfile.ID); lp != nil {
|
||||
t.Fatalf("found profile for user2 in user1's profile list")
|
||||
}
|
||||
|
||||
pm.SetCurrentUserID("user2")
|
||||
checkProfiles(t, "carol")
|
||||
if lp := pm.findProfilesByNodeID(carol.ControlURL, carol.NodeID); lp == nil {
|
||||
t.Fatalf("did not find profile for user2 in user2's profile list")
|
||||
}
|
||||
if lp := pm.findProfilesByUserID(carol.ControlURL, carol.UserProfile.ID); lp == nil {
|
||||
t.Fatalf("did not find profile for user2 in user2's profile list")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// TestProfileManagement tests creating, loading, and switching profiles.
|
||||
|
||||
Reference in New Issue
Block a user