summaryrefslogtreecommitdiffhomepage
path: root/control/controlclient/controlclient_test.go
AgeCommit message (Collapse)AuthorFilesLines
2024-04-16all: use Go 1.22 range-over-intBrad Fitzpatrick1-1/+1
Updates #11058 Change-Id: I35e7ef9b90e83cac04ca93fd964ad00ed5b48430 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2024-02-08all: use reflect.TypeFor now available in Go 1.22 (#11078)Joe Tsai1-1/+1
Updates #cleanup Signed-off-by: Joe Tsai <joetsai@digital-static.net>
2023-09-01control/controlclient: clean up various things in prep for state overhaulBrad Fitzpatrick1-6/+1
We want the overall state (used only for tests) to be computed from the individual states of each component, rather than moving the state around by hand in dozens of places. In working towards that, we found a lot of things to clean up. Updates #cleanup Change-Id: Ieaaae5355dfae789a8ec7a56ce212f1d7e3a92db Co-authored-by: Maisem Ali <maisem@tailscale.com> Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2023-08-30control/controlclient: delete Status.Log{in,out}FinishedBrad Fitzpatrick1-8/+1
They were entirely redundant and 1:1 with the status field so this turns them into methods instead. Updates #cleanup Updates #1909 Change-Id: I7d939750749edf7dae4c97566bbeb99f2f75adbc Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2023-08-30control/controlclient: unexport Status.state, add test-only accessorBrad Fitzpatrick1-5/+5
Updates #cleanup Updates #1909 Change-Id: I38dcde6fa0de0f58ede4529992cee2e36de33dd6 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2023-01-27all: update copyright and license headersWill Norris1-3/+2
This updates all source files to use a new standard header for copyright and license declaration. Notably, copyright no longer includes a date, and we now use the standard SPDX-License-Identifier header. This commit was done almost entirely mechanically with perl, and then some minimal manual fixes. Updates #6865 Signed-off-by: Will Norris <will@tailscale.com>
2022-05-03control/controlclient: store netinfo and hostinfo separatelyMaisem Ali1-1/+1
Currently, when SetNetInfo is called it sets the value on hostinfo.NetInfo. However, when SetHostInfo is called it overwrites the hostinfo field which may mean it also clears out the NetInfo it had just received. This commit stores NetInfo separately and combines it into Hostinfo as needed so that control is always notified of the latest values. Also, remove unused copies of Hostinfo from ipn.Status and controlclient.Auto. Updates #tailscale/corp#4824 (maybe fixes) Signed-off-by: Maisem Ali <maisem@tailscale.com>
2021-08-20hostinfo: add SetDeviceModel setter, move remaining code from controlclientBrad Fitzpatrick1-7/+0
Updates tailscale/corp#1959 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2021-05-31ipnlocal: don't assume NeedsLogin immediately after StartLogout().Avery Pennarun1-1/+1
Previously, there was no server round trip required to log out, so when you asked ipnlocal to Logout(), it could clear the netmap immediately and switch to NeedsLogin state. In v1.8, we added a true Logout operation. ipn.Logout() would trigger an async cc.StartLogout() and *also* immediately switch to NeedsLogin. Unfortunately, some frontends would see NeedsLogin and immediately trigger a new StartInteractiveLogin() operation, before the controlclient auth state machine actually acted on the Logout command, thus accidentally invalidating the entire logout operation, retaining the netmap, and violating the user's expectations. Instead, add a new LogoutFinished signal from controlclient (paralleling LoginFinished) and, upon starting a logout, don't update the ipn state machine until it's received. Updates: #1918 (BUG-2) Signed-off-by: Avery Pennarun <apenwarr@tailscale.com>
2021-04-30controlclient: extract a Client interface and rename Client->Auto.Avery Pennarun1-1/+1
This will let us create a mock or fake Client implementation for use with ipn.Backend. Signed-off-by: Avery Pennarun <apenwarr@tailscale.com>
2021-01-08cover one more case in TestStatusEqual.Denton Gentry1-0/+5
Signed-off-by: Denton Gentry <dgentry@tailscale.com>
2020-07-27tailcfg, control/controlclient: add GoArch, populate OSVersion on LinuxBrad Fitzpatrick1-0/+7
2020-05-27control/controlclient: move auto_test back to corp repo.David Anderson1-5/+5
It can't run without corp stuff anyway, and makes it harder to refactor the control server.
2020-05-03types/structs: add structs.Incomparable annotation, use it where applicableBrad Fitzpatrick1-1/+3
Shotizam before and output queries: sqlite> select sum(size) from bin where func like 'type..%'; 129067 => 120216
2020-02-14types/empty: add Message, stop using mysterious *struct{}Brad Fitzpatrick1-1/+3
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2020-02-09Move Linux client & common packages into a public repo.Earl Lee1-0/+68