MCPcopy Create free account
hub / github.com/tailscale/tailscale / diskPrefs

Method diskPrefs

tstest/integration/integration.go:655–670  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

653}
654
655func (n *TestNode) diskPrefs() *ipn.Prefs {
656 t := n.env.t
657 t.Helper()
658 if _, err := os.ReadFile(n.stateFile); err != nil {
659 t.Fatalf("reading prefs: %v", err)
660 }
661 fs, err := store.New(nil, n.stateFile)
662 if err != nil {
663 t.Fatalf("reading prefs, NewFileStore: %v", err)
664 }
665 p, err := ipnlocal.ReadStartupPrefsForTest(t.Logf, fs)
666 if err != nil {
667 t.Fatalf("reading prefs, ReadDiskPrefsForTest: %v", err)
668 }
669 return p.AsStruct()
670}
671
672// AwaitResponding waits for n's tailscaled to be up enough to be
673// responding, but doesn't wait for any particular state.

Callers 2

TestStateSavedOnStartFunction · 0.95
testAutoUpdateDefaultsFunction · 0.95

Calls 6

NewFunction · 0.92
ReadStartupPrefsForTestFunction · 0.92
HelperMethod · 0.65
ReadFileMethod · 0.65
FatalfMethod · 0.65
AsStructMethod · 0.65

Tested by 2

TestStateSavedOnStartFunction · 0.76
testAutoUpdateDefaultsFunction · 0.76