net/dnsfallback: allow setting log function (#5550)
This broke a test in corp that enforces we don't use the log package. Signed-off-by: Andrew Dunham <andrew@tailscale.com>
This commit is contained in:
@ -25,6 +25,11 @@ func TestGetDERPMap(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestCache(t *testing.T) {
|
||||
oldlog := logfunc.Load()
|
||||
SetLogger(t.Logf)
|
||||
t.Cleanup(func() {
|
||||
SetLogger(oldlog)
|
||||
})
|
||||
cacheFile := filepath.Join(t.TempDir(), "cache.json")
|
||||
|
||||
// Write initial cache value
|
||||
@ -101,6 +106,11 @@ func TestCache(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestCacheUnchanged(t *testing.T) {
|
||||
oldlog := logfunc.Load()
|
||||
SetLogger(t.Logf)
|
||||
t.Cleanup(func() {
|
||||
SetLogger(oldlog)
|
||||
})
|
||||
cacheFile := filepath.Join(t.TempDir(), "cache.json")
|
||||
|
||||
// Write initial cache value
|
||||
|
Reference in New Issue
Block a user