@ -24,6 +24,7 @@ import (
"tailscale.com/tka"
"tailscale.com/tstest"
"tailscale.com/types/logger"
"tailscale.com/types/opt"
"tailscale.com/types/persist"
"tailscale.com/types/preftype"
"tailscale.com/version/distro"
@ -176,9 +177,10 @@ func TestCheckForAccidentalSettingReverts(t *testing.T) {
name : "bare_up_means_up" ,
flags : [ ] string { } ,
curPrefs : & ipn . Prefs {
ControlURL : ipn . DefaultControlURL ,
WantRunning : false ,
Hostname : "foo" ,
ControlURL : ipn . DefaultControlURL ,
WantRunning : false ,
Hostname : "foo" ,
NoStatefulFiltering : opt . NewBool ( true ) ,
} ,
want : "" ,
} ,
@ -186,12 +188,13 @@ func TestCheckForAccidentalSettingReverts(t *testing.T) {
name : "losing_hostname" ,
flags : [ ] string { "--accept-dns" } ,
curPrefs : & ipn . Prefs {
ControlURL : ipn . DefaultControlURL ,
WantRunning : false ,
Hostname : "foo" ,
CorpDNS : true ,
NetfilterMode : preftype . NetfilterOn ,
AllowSingleHosts : true ,
ControlURL : ipn . DefaultControlURL ,
WantRunning : false ,
Hostname : "foo" ,
CorpDNS : true ,
NetfilterMode : preftype . NetfilterOn ,
AllowSingleHosts : true ,
NoStatefulFiltering : opt . NewBool ( true ) ,
} ,
want : accidentalUpPrefix + " --accept-dns --hostname=foo" ,
} ,
@ -199,11 +202,12 @@ func TestCheckForAccidentalSettingReverts(t *testing.T) {
name : "hostname_changing_explicitly" ,
flags : [ ] string { "--hostname=bar" } ,
curPrefs : & ipn . Prefs {
ControlURL : ipn . DefaultControlURL ,
CorpDNS : true ,
NetfilterMode : preftype . NetfilterOn ,
AllowSingleHosts : true ,
Hostname : "foo" ,
ControlURL : ipn . DefaultControlURL ,
CorpDNS : true ,
NetfilterMode : preftype . NetfilterOn ,
AllowSingleHosts : true ,
Hostname : "foo" ,
NoStatefulFiltering : opt . NewBool ( true ) ,
} ,
want : "" ,
} ,
@ -211,11 +215,12 @@ func TestCheckForAccidentalSettingReverts(t *testing.T) {
name : "hostname_changing_empty_explicitly" ,
flags : [ ] string { "--hostname=" } ,
curPrefs : & ipn . Prefs {
ControlURL : ipn . DefaultControlURL ,
CorpDNS : true ,
NetfilterMode : preftype . NetfilterOn ,
AllowSingleHosts : true ,
Hostname : "foo" ,
ControlURL : ipn . DefaultControlURL ,
CorpDNS : true ,
NetfilterMode : preftype . NetfilterOn ,
AllowSingleHosts : true ,
Hostname : "foo" ,
NoStatefulFiltering : opt . NewBool ( true ) ,
} ,
want : "" ,
} ,
@ -231,11 +236,12 @@ func TestCheckForAccidentalSettingReverts(t *testing.T) {
name : "implicit_operator_change" ,
flags : [ ] string { "--hostname=foo" } ,
curPrefs : & ipn . Prefs {
ControlURL : ipn . DefaultControlURL ,
OperatorUser : "alice" ,
AllowSingleHosts : true ,
CorpDNS : true ,
NetfilterMode : preftype . NetfilterOn ,
ControlURL : ipn . DefaultControlURL ,
OperatorUser : "alice" ,
AllowSingleHosts : true ,
CorpDNS : true ,
NetfilterMode : preftype . NetfilterOn ,
NoStatefulFiltering : opt . NewBool ( true ) ,
} ,
curUser : "eve" ,
want : accidentalUpPrefix + " --hostname=foo --operator=alice" ,
@ -244,11 +250,12 @@ func TestCheckForAccidentalSettingReverts(t *testing.T) {
name : "implicit_operator_matches_shell_user" ,
flags : [ ] string { "--hostname=foo" } ,
curPrefs : & ipn . Prefs {
ControlURL : ipn . DefaultControlURL ,
AllowSingleHosts : true ,
CorpDNS : true ,
NetfilterMode : preftype . NetfilterOn ,
OperatorUser : "alice" ,
ControlURL : ipn . DefaultControlURL ,
AllowSingleHosts : true ,
CorpDNS : true ,
NetfilterMode : preftype . NetfilterOn ,
OperatorUser : "alice" ,
NoStatefulFiltering : opt . NewBool ( true ) ,
} ,
curUser : "alice" ,
want : "" ,
@ -266,6 +273,7 @@ func TestCheckForAccidentalSettingReverts(t *testing.T) {
netip . MustParsePrefix ( "0.0.0.0/0" ) ,
netip . MustParsePrefix ( "::/0" ) ,
} ,
NoStatefulFiltering : opt . NewBool ( true ) ,
} ,
want : accidentalUpPrefix + " --advertise-routes=10.0.42.0/24 --advertise-exit-node" ,
} ,
@ -282,6 +290,7 @@ func TestCheckForAccidentalSettingReverts(t *testing.T) {
netip . MustParsePrefix ( "0.0.0.0/0" ) ,
netip . MustParsePrefix ( "::/0" ) ,
} ,
NoStatefulFiltering : opt . NewBool ( true ) ,
} ,
want : "" ,
} ,
@ -298,6 +307,7 @@ func TestCheckForAccidentalSettingReverts(t *testing.T) {
netip . MustParsePrefix ( "0.0.0.0/0" ) ,
netip . MustParsePrefix ( "::/0" ) ,
} ,
NoStatefulFiltering : opt . NewBool ( true ) ,
} ,
want : "" ,
} ,
@ -305,10 +315,11 @@ func TestCheckForAccidentalSettingReverts(t *testing.T) {
name : "advertise_exit_node" , // Issue 1859
flags : [ ] string { "--advertise-exit-node" } ,
curPrefs : & ipn . Prefs {
ControlURL : ipn . DefaultControlURL ,
AllowSingleHosts : true ,
CorpDNS : true ,
NetfilterMode : preftype . NetfilterOn ,
ControlURL : ipn . DefaultControlURL ,
AllowSingleHosts : true ,
CorpDNS : true ,
NetfilterMode : preftype . NetfilterOn ,
NoStatefulFiltering : opt . NewBool ( true ) ,
} ,
want : "" ,
} ,
@ -324,6 +335,7 @@ func TestCheckForAccidentalSettingReverts(t *testing.T) {
AdvertiseRoutes : [ ] netip . Prefix {
netip . MustParsePrefix ( "1.2.0.0/16" ) ,
} ,
NoStatefulFiltering : opt . NewBool ( true ) ,
} ,
want : accidentalUpPrefix + " --advertise-exit-node --advertise-routes=1.2.0.0/16" ,
} ,
@ -340,6 +352,7 @@ func TestCheckForAccidentalSettingReverts(t *testing.T) {
netip . MustParsePrefix ( "::/0" ) ,
netip . MustParsePrefix ( "1.2.0.0/16" ) ,
} ,
NoStatefulFiltering : opt . NewBool ( true ) ,
} ,
want : accidentalUpPrefix + " --advertise-exit-node --advertise-routes=1.2.0.0/16" ,
} ,
@ -352,7 +365,8 @@ func TestCheckForAccidentalSettingReverts(t *testing.T) {
CorpDNS : true ,
NetfilterMode : preftype . NetfilterOn ,
ExitNodeID : "fooID" ,
ExitNodeID : "fooID" ,
NoStatefulFiltering : opt . NewBool ( true ) ,
} ,
want : "" ,
} ,
@ -375,8 +389,9 @@ func TestCheckForAccidentalSettingReverts(t *testing.T) {
netip . MustParsePrefix ( "0.0.0.0/0" ) ,
netip . MustParsePrefix ( "::/0" ) ,
} ,
NetfilterMode : preftype . NetfilterNoDivert ,
OperatorUser : "alice" ,
NetfilterMode : preftype . NetfilterNoDivert ,
OperatorUser : "alice" ,
NoStatefulFiltering : opt . NewBool ( true ) ,
} ,
curUser : "eve" ,
want : accidentalUpPrefix + " --force-reauth --accept-dns=false --accept-routes --advertise-exit-node --advertise-routes=10.0.0.0/16 --advertise-tags=tag:foo,tag:bar --exit-node=100.64.5.6 --host-routes=false --hostname=myhostname --netfilter-mode=nodivert --operator=alice --shields-up" ,
@ -398,8 +413,9 @@ func TestCheckForAccidentalSettingReverts(t *testing.T) {
AdvertiseRoutes : [ ] netip . Prefix {
netip . MustParsePrefix ( "10.0.0.0/16" ) ,
} ,
NetfilterMode : preftype . NetfilterNoDivert ,
OperatorUser : "alice" ,
NetfilterMode : preftype . NetfilterNoDivert ,
OperatorUser : "alice" ,
NoStatefulFiltering : opt . NewBool ( true ) ,
} ,
curUser : "eve" ,
want : accidentalUpPrefix + " --hostname=newhostname --accept-dns=false --accept-routes --advertise-routes=10.0.0.0/16 --advertise-tags=tag:foo,tag:bar --exit-node=100.64.5.6 --host-routes=false --netfilter-mode=nodivert --operator=alice --shields-up" ,
@ -408,11 +424,12 @@ func TestCheckForAccidentalSettingReverts(t *testing.T) {
name : "loggedout_is_implicit" ,
flags : [ ] string { "--hostname=foo" } ,
curPrefs : & ipn . Prefs {
ControlURL : ipn . DefaultControlURL ,
LoggedOut : true ,
AllowSingleHosts : true ,
CorpDNS : true ,
NetfilterMode : preftype . NetfilterOn ,
ControlURL : ipn . DefaultControlURL ,
LoggedOut : true ,
AllowSingleHosts : true ,
CorpDNS : true ,
NetfilterMode : preftype . NetfilterOn ,
NoStatefulFiltering : opt . NewBool ( true ) ,
} ,
want : "" , // not an error. LoggedOut is implicit.
} ,
@ -458,6 +475,7 @@ func TestCheckForAccidentalSettingReverts(t *testing.T) {
netip . MustParsePrefix ( "::/0" ) ,
netip . MustParsePrefix ( "1.2.0.0/16" ) ,
} ,
NoStatefulFiltering : opt . NewBool ( true ) ,
} ,
want : accidentalUpPrefix + " --operator=expbits --advertise-exit-node --advertise-routes=1.2.0.0/16" ,
} ,
@ -474,6 +492,7 @@ func TestCheckForAccidentalSettingReverts(t *testing.T) {
netip . MustParsePrefix ( "::/0" ) ,
netip . MustParsePrefix ( "1.2.0.0/16" ) ,
} ,
NoStatefulFiltering : opt . NewBool ( true ) ,
} ,
want : accidentalUpPrefix + " --advertise-routes=1.2.0.0/16 --operator=expbits --advertise-exit-node" ,
} ,
@ -487,7 +506,8 @@ func TestCheckForAccidentalSettingReverts(t *testing.T) {
NetfilterMode : preftype . NetfilterOn ,
AllowSingleHosts : true ,
Hostname : "foo" ,
Hostname : "foo" ,
NoStatefulFiltering : opt . NewBool ( true ) ,
} ,
want : accidentalUpPrefix + " --auth-key=secretrand --force-reauth=false --reset --hostname=foo" ,
} ,
@ -500,7 +520,8 @@ func TestCheckForAccidentalSettingReverts(t *testing.T) {
CorpDNS : true ,
NetfilterMode : preftype . NetfilterOn ,
ExitNodeIP : netip . MustParseAddr ( "100.64.5.4" ) ,
ExitNodeIP : netip . MustParseAddr ( "100.64.5.4" ) ,
NoStatefulFiltering : opt . NewBool ( true ) ,
} ,
want : accidentalUpPrefix + " --hostname=foo --exit-node=100.64.5.4" ,
} ,
@ -514,7 +535,8 @@ func TestCheckForAccidentalSettingReverts(t *testing.T) {
CorpDNS : true ,
NetfilterMode : preftype . NetfilterOn ,
ExitNodeID : "some_stable_id" ,
ExitNodeID : "some_stable_id" ,
NoStatefulFiltering : opt . NewBool ( true ) ,
} ,
want : accidentalUpPrefix + " --hostname=foo --exit-node=100.64.5.7" ,
} ,
@ -530,6 +552,7 @@ func TestCheckForAccidentalSettingReverts(t *testing.T) {
ExitNodeAllowLANAccess : true ,
ExitNodeID : "some_stable_id" ,
NoStatefulFiltering : opt . NewBool ( true ) ,
} ,
want : accidentalUpPrefix + " --hostname=foo --exit-node-allow-lan-access --exit-node=100.2.3.4" ,
} ,
@ -537,10 +560,11 @@ func TestCheckForAccidentalSettingReverts(t *testing.T) {
name : "ignore_login_server_synonym" ,
flags : [ ] string { "--login-server=https://controlplane.tailscale.com" } ,
curPrefs : & ipn . Prefs {
ControlURL : "https://login.tailscale.com" ,
AllowSingleHosts : true ,
CorpDNS : true ,
NetfilterMode : preftype . NetfilterOn ,
ControlURL : "https://login.tailscale.com" ,
AllowSingleHosts : true ,
CorpDNS : true ,
NetfilterMode : preftype . NetfilterOn ,
NoStatefulFiltering : opt . NewBool ( true ) ,
} ,
want : "" , // not an error
} ,
@ -548,10 +572,11 @@ func TestCheckForAccidentalSettingReverts(t *testing.T) {
name : "ignore_login_server_synonym_on_other_change" ,
flags : [ ] string { "--netfilter-mode=off" } ,
curPrefs : & ipn . Prefs {
ControlURL : "https://login.tailscale.com" ,
AllowSingleHosts : true ,
CorpDNS : false ,
NetfilterMode : preftype . NetfilterOn ,
ControlURL : "https://login.tailscale.com" ,
AllowSingleHosts : true ,
CorpDNS : false ,
NetfilterMode : preftype . NetfilterOn ,
NoStatefulFiltering : opt . NewBool ( true ) ,
} ,
want : accidentalUpPrefix + " --netfilter-mode=off --accept-dns=false" ,
} ,
@ -561,11 +586,12 @@ func TestCheckForAccidentalSettingReverts(t *testing.T) {
name : "synology_permit_omit_accept_routes" ,
flags : [ ] string { "--hostname=foo" } ,
curPrefs : & ipn . Prefs {
ControlURL : "https://login.tailscale.com" ,
CorpDNS : true ,
AllowSingleHosts : true ,
RouteAll : true ,
NetfilterMode : preftype . NetfilterOn ,
ControlURL : "https://login.tailscale.com" ,
CorpDNS : true ,
AllowSingleHosts : true ,
RouteAll : true ,
NetfilterMode : preftype . NetfilterOn ,
NoStatefulFiltering : opt . NewBool ( true ) ,
} ,
goos : "linux" ,
distro : distro . Synology ,
@ -577,11 +603,12 @@ func TestCheckForAccidentalSettingReverts(t *testing.T) {
name : "not_synology_dont_permit_omit_accept_routes" ,
flags : [ ] string { "--hostname=foo" } ,
curPrefs : & ipn . Prefs {
ControlURL : "https://login.tailscale.com" ,
CorpDNS : true ,
AllowSingleHosts : true ,
RouteAll : true ,
NetfilterMode : preftype . NetfilterOn ,
ControlURL : "https://login.tailscale.com" ,
CorpDNS : true ,
AllowSingleHosts : true ,
RouteAll : true ,
NetfilterMode : preftype . NetfilterOn ,
NoStatefulFiltering : opt . NewBool ( true ) ,
} ,
goos : "linux" ,
distro : "" , // not Synology
@ -591,11 +618,12 @@ func TestCheckForAccidentalSettingReverts(t *testing.T) {
name : "profile_name_ignored_in_up" ,
flags : [ ] string { "--hostname=foo" } ,
curPrefs : & ipn . Prefs {
ControlURL : "https://login.tailscale.com" ,
CorpDNS : true ,
AllowSingleHosts : true ,
NetfilterMode : preftype . NetfilterOn ,
ProfileName : "foo" ,
ControlURL : "https://login.tailscale.com" ,
CorpDNS : true ,
AllowSingleHosts : true ,
NetfilterMode : preftype . NetfilterOn ,
ProfileName : "foo" ,
NoStatefulFiltering : opt . NewBool ( true ) ,
} ,
goos : "linux" ,
want : "" ,
@ -658,7 +686,7 @@ func TestPrefsFromUpArgs(t *testing.T) {
ControlURL : ipn . DefaultControlURL ,
WantRunning : true ,
NoSNAT : false ,
NoStatefulFiltering : " fals e",
NoStatefulFiltering : " tru e",
NetfilterMode : preftype . NetfilterOn ,
CorpDNS : true ,
AllowSingleHosts : true ,
@ -678,7 +706,7 @@ func TestPrefsFromUpArgs(t *testing.T) {
AllowSingleHosts : true ,
RouteAll : true ,
NoSNAT : false ,
NoStatefulFiltering : " fals e",
NoStatefulFiltering : " tru e",
NetfilterMode : preftype . NetfilterOn ,
AutoUpdate : ipn . AutoUpdatePrefs {
Check : true ,
@ -697,7 +725,7 @@ func TestPrefsFromUpArgs(t *testing.T) {
netip . MustParsePrefix ( "0.0.0.0/0" ) ,
netip . MustParsePrefix ( "::/0" ) ,
} ,
NoStatefulFiltering : " fals e",
NoStatefulFiltering : " tru e",
NetfilterMode : preftype . NetfilterOn ,
AutoUpdate : ipn . AutoUpdatePrefs {
Check : true ,
@ -1062,11 +1090,12 @@ func TestUpdatePrefs(t *testing.T) {
name : "change_login_server" ,
flags : [ ] string { "--login-server=https://localhost:1000" } ,
curPrefs : & ipn . Prefs {
ControlURL : "https://login.tailscale.com" ,
Persist : & persist . Persist { UserProfile : tailcfg . UserProfile { LoginName : "crawshaw.github" } } ,
AllowSingleHosts : true ,
CorpDNS : true ,
NetfilterMode : preftype . NetfilterOn ,
ControlURL : "https://login.tailscale.com" ,
Persist : & persist . Persist { UserProfile : tailcfg . UserProfile { LoginName : "crawshaw.github" } } ,
AllowSingleHosts : true ,
CorpDNS : true ,
NetfilterMode : preftype . NetfilterOn ,
NoStatefulFiltering : opt . NewBool ( true ) ,
} ,
env : upCheckEnv { backendState : "Running" } ,
wantSimpleUp : true ,
@ -1077,11 +1106,12 @@ func TestUpdatePrefs(t *testing.T) {
name : "change_tags" ,
flags : [ ] string { "--advertise-tags=tag:foo" } ,
curPrefs : & ipn . Prefs {
ControlURL : "https://login.tailscale.com" ,
Persist : & persist . Persist { UserProfile : tailcfg . UserProfile { LoginName : "crawshaw.github" } } ,
AllowSingleHosts : true ,
CorpDNS : true ,
NetfilterMode : preftype . NetfilterOn ,
ControlURL : "https://login.tailscale.com" ,
Persist : & persist . Persist { UserProfile : tailcfg . UserProfile { LoginName : "crawshaw.github" } } ,
AllowSingleHosts : true ,
CorpDNS : true ,
NetfilterMode : preftype . NetfilterOn ,
NoStatefulFiltering : opt . NewBool ( true ) ,
} ,
env : upCheckEnv { backendState : "Running" } ,
} ,
@ -1090,11 +1120,12 @@ func TestUpdatePrefs(t *testing.T) {
name : "explicit_empty_operator" ,
flags : [ ] string { "--operator=" } ,
curPrefs : & ipn . Prefs {
ControlURL : "https://login.tailscale.com" ,
CorpDNS : true ,
AllowSingleHosts : true ,
NetfilterMode : preftype . NetfilterOn ,
OperatorUser : "somebody" ,
ControlURL : "https://login.tailscale.com" ,
CorpDNS : true ,
AllowSingleHosts : true ,
NetfilterMode : preftype . NetfilterOn ,
OperatorUser : "somebody" ,
NoStatefulFiltering : opt . NewBool ( true ) ,
} ,
env : upCheckEnv { user : "somebody" , backendState : "Running" } ,
wantJustEditMP : & ipn . MaskedPrefs {
@ -1111,11 +1142,12 @@ func TestUpdatePrefs(t *testing.T) {
name : "enable_ssh" ,
flags : [ ] string { "--ssh" } ,
curPrefs : & ipn . Prefs {
ControlURL : "https://login.tailscale.com" ,
Persist : & persist . Persist { UserProfile : tailcfg . UserProfile { LoginName : "crawshaw.github" } } ,
AllowSingleHosts : true ,
CorpDNS : true ,
NetfilterMode : preftype . NetfilterOn ,
ControlURL : "https://login.tailscale.com" ,
Persist : & persist . Persist { UserProfile : tailcfg . UserProfile { LoginName : "crawshaw.github" } } ,
AllowSingleHosts : true ,
CorpDNS : true ,
NetfilterMode : preftype . NetfilterOn ,
NoStatefulFiltering : opt . NewBool ( true ) ,
} ,
wantJustEditMP : & ipn . MaskedPrefs {
RunSSHSet : true ,
@ -1132,12 +1164,13 @@ func TestUpdatePrefs(t *testing.T) {
name : "disable_ssh" ,
flags : [ ] string { "--ssh=false" } ,
curPrefs : & ipn . Prefs {
ControlURL : "https://login.tailscale.com" ,
Persist : & persist . Persist { UserProfile : tailcfg . UserProfile { LoginName : "crawshaw.github" } } ,
AllowSingleHosts : true ,
CorpDNS : true ,
RunSSH : true ,
NetfilterMode : preftype . NetfilterOn ,
ControlURL : "https://login.tailscale.com" ,
Persist : & persist . Persist { UserProfile : tailcfg . UserProfile { LoginName : "crawshaw.github" } } ,
AllowSingleHosts : true ,
CorpDNS : true ,
RunSSH : true ,
NetfilterMode : preftype . NetfilterOn ,
NoStatefulFiltering : opt . NewBool ( true ) ,
} ,
wantJustEditMP : & ipn . MaskedPrefs {
RunSSHSet : true ,
@ -1157,12 +1190,13 @@ func TestUpdatePrefs(t *testing.T) {
flags : [ ] string { "--ssh=false" } ,
sshOverTailscale : true ,
curPrefs : & ipn . Prefs {
ControlURL : "https://login.tailscale.com" ,
Persist : & persist . Persist { UserProfile : tailcfg . UserProfile { LoginName : "crawshaw.github" } } ,
AllowSingleHosts : true ,
CorpDNS : true ,
NetfilterMode : preftype . NetfilterOn ,
RunSSH : true ,
ControlURL : "https://login.tailscale.com" ,
Persist : & persist . Persist { UserProfile : tailcfg . UserProfile { LoginName : "crawshaw.github" } } ,
AllowSingleHosts : true ,
CorpDNS : true ,
NetfilterMode : preftype . NetfilterOn ,
RunSSH : true ,
NoStatefulFiltering : opt . NewBool ( true ) ,
} ,
wantJustEditMP : & ipn . MaskedPrefs {
RunSSHSet : true ,
@ -1181,11 +1215,12 @@ func TestUpdatePrefs(t *testing.T) {
flags : [ ] string { "--ssh=true" } ,
sshOverTailscale : true ,
curPrefs : & ipn . Prefs {
ControlURL : "https://login.tailscale.com" ,
Persist : & persist . Persist { UserProfile : tailcfg . UserProfile { LoginName : "crawshaw.github" } } ,
AllowSingleHosts : true ,
CorpDNS : true ,
NetfilterMode : preftype . NetfilterOn ,
ControlURL : "https://login.tailscale.com" ,
Persist : & persist . Persist { UserProfile : tailcfg . UserProfile { LoginName : "crawshaw.github" } } ,
AllowSingleHosts : true ,
CorpDNS : true ,
NetfilterMode : preftype . NetfilterOn ,
NoStatefulFiltering : opt . NewBool ( true ) ,
} ,
wantJustEditMP : & ipn . MaskedPrefs {
RunSSHSet : true ,
@ -1204,11 +1239,12 @@ func TestUpdatePrefs(t *testing.T) {
flags : [ ] string { "--ssh=true" , "--accept-risk=lose-ssh" } ,
sshOverTailscale : true ,
curPrefs : & ipn . Prefs {
ControlURL : "https://login.tailscale.com" ,
Persist : & persist . Persist { UserProfile : tailcfg . UserProfile { LoginName : "crawshaw.github" } } ,
AllowSingleHosts : true ,
CorpDNS : true ,
NetfilterMode : preftype . NetfilterOn ,
ControlURL : "https://login.tailscale.com" ,
Persist : & persist . Persist { UserProfile : tailcfg . UserProfile { LoginName : "crawshaw.github" } } ,
AllowSingleHosts : true ,
CorpDNS : true ,
NetfilterMode : preftype . NetfilterOn ,
NoStatefulFiltering : opt . NewBool ( true ) ,
} ,
wantJustEditMP : & ipn . MaskedPrefs {
RunSSHSet : true ,
@ -1226,12 +1262,13 @@ func TestUpdatePrefs(t *testing.T) {
flags : [ ] string { "--ssh=false" , "--accept-risk=lose-ssh" } ,
sshOverTailscale : true ,
curPrefs : & ipn . Prefs {
ControlURL : "https://login.tailscale.com" ,
Persist : & persist . Persist { UserProfile : tailcfg . UserProfile { LoginName : "crawshaw.github" } } ,
AllowSingleHosts : true ,
CorpDNS : true ,
RunSSH : true ,
NetfilterMode : preftype . NetfilterOn ,
ControlURL : "https://login.tailscale.com" ,
Persist : & persist . Persist { UserProfile : tailcfg . UserProfile { LoginName : "crawshaw.github" } } ,
AllowSingleHosts : true ,
CorpDNS : true ,
RunSSH : true ,
NetfilterMode : preftype . NetfilterOn ,
NoStatefulFiltering : opt . NewBool ( true ) ,
} ,
wantJustEditMP : & ipn . MaskedPrefs {
RunSSHSet : true ,
@ -1249,10 +1286,11 @@ func TestUpdatePrefs(t *testing.T) {
flags : [ ] string { "--force-reauth" } ,
sshOverTailscale : true ,
curPrefs : & ipn . Prefs {
ControlURL : "https://login.tailscale.com" ,
AllowSingleHosts : true ,
CorpDNS : true ,
NetfilterMode : preftype . NetfilterOn ,
ControlURL : "https://login.tailscale.com" ,
AllowSingleHosts : true ,
CorpDNS : true ,
NetfilterMode : preftype . NetfilterOn ,
NoStatefulFiltering : opt . NewBool ( true ) ,
} ,
env : upCheckEnv { backendState : "Running" } ,
wantErrSubtr : "aborted, no changes made" ,
@ -1262,10 +1300,11 @@ func TestUpdatePrefs(t *testing.T) {
flags : [ ] string { "--force-reauth" , "--accept-risk=lose-ssh" } ,
sshOverTailscale : true ,
curPrefs : & ipn . Prefs {
ControlURL : "https://login.tailscale.com" ,
AllowSingleHosts : true ,
CorpDNS : true ,
NetfilterMode : preftype . NetfilterOn ,
ControlURL : "https://login.tailscale.com" ,
AllowSingleHosts : true ,
CorpDNS : true ,
NetfilterMode : preftype . NetfilterOn ,
NoStatefulFiltering : opt . NewBool ( true ) ,
} ,
wantJustEditMP : nil ,
env : upCheckEnv { backendState : "Running" } ,
@ -1274,10 +1313,11 @@ func TestUpdatePrefs(t *testing.T) {
name : "advertise_connector" ,
flags : [ ] string { "--advertise-connector" } ,
curPrefs : & ipn . Prefs {
ControlURL : ipn . DefaultControlURL ,
AllowSingleHosts : true ,
CorpDNS : true ,
NetfilterMode : preftype . NetfilterOn ,
ControlURL : ipn . DefaultControlURL ,
AllowSingleHosts : true ,
CorpDNS : true ,
NetfilterMode : preftype . NetfilterOn ,
NoStatefulFiltering : opt . NewBool ( true ) ,
} ,
wantJustEditMP : & ipn . MaskedPrefs {
AppConnectorSet : true ,
@ -1301,6 +1341,7 @@ func TestUpdatePrefs(t *testing.T) {
AppConnector : ipn . AppConnectorPrefs {
Advertise : true ,
} ,
NoStatefulFiltering : opt . NewBool ( true ) ,
} ,
wantJustEditMP : & ipn . MaskedPrefs {
AppConnectorSet : true ,