mirror of
https://github.com/tailscale/tailscale.git
synced 2025-04-16 19:51:41 +00:00
ipn/ipnlocal: fix TestOnTailnetDefaultAutoUpdate on unsupported platforms (#11921)
Fixes #11894 Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
This commit is contained in:
parent
7d9c3f9897
commit
7ba8f03936
@ -15,7 +15,6 @@ import (
|
|||||||
"net/netip"
|
"net/netip"
|
||||||
"os"
|
"os"
|
||||||
"reflect"
|
"reflect"
|
||||||
"runtime"
|
|
||||||
"slices"
|
"slices"
|
||||||
"sync"
|
"sync"
|
||||||
"testing"
|
"testing"
|
||||||
@ -2283,9 +2282,6 @@ func TestPreferencePolicyInfo(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestOnTailnetDefaultAutoUpdate(t *testing.T) {
|
func TestOnTailnetDefaultAutoUpdate(t *testing.T) {
|
||||||
if runtime.GOOS == "darwin" {
|
|
||||||
t.Skip("test broken on macOS; see https://github.com/tailscale/tailscale/issues/11894")
|
|
||||||
}
|
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
before, after opt.Bool
|
before, after opt.Bool
|
||||||
tailnetDefault bool
|
tailnetDefault bool
|
||||||
@ -2330,7 +2326,14 @@ func TestOnTailnetDefaultAutoUpdate(t *testing.T) {
|
|||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
b.onTailnetDefaultAutoUpdate(tt.tailnetDefault)
|
b.onTailnetDefaultAutoUpdate(tt.tailnetDefault)
|
||||||
if want, got := tt.after, b.pm.CurrentPrefs().AutoUpdate().Apply; got != want {
|
want := tt.after
|
||||||
|
// On platforms that don't support auto-update we can never
|
||||||
|
// transition to auto-updates being enabled. The value should
|
||||||
|
// remain unchanged after onTailnetDefaultAutoUpdate.
|
||||||
|
if !clientupdate.CanAutoUpdate() && want.EqualBool(true) {
|
||||||
|
want = tt.before
|
||||||
|
}
|
||||||
|
if got := b.pm.CurrentPrefs().AutoUpdate().Apply; got != want {
|
||||||
t.Errorf("got: %q, want %q", got, want)
|
t.Errorf("got: %q, want %q", got, want)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user