mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-13 06:07:34 +00:00
all: use tstest.Replace more
Signed-off-by: Maisem Ali <maisem@tailscale.com>
This commit is contained in:
@@ -497,8 +497,7 @@ func (panicOnUseTransport) RoundTrip(*http.Request) (*http.Response, error) {
|
||||
|
||||
// Issue 1573: don't generate a machine key if we don't want to be running.
|
||||
func TestLazyMachineKeyGeneration(t *testing.T) {
|
||||
defer func(old func() bool) { panicOnMachineKeyGeneration = old }(panicOnMachineKeyGeneration)
|
||||
panicOnMachineKeyGeneration = func() bool { return true }
|
||||
tstest.Replace(t, &panicOnMachineKeyGeneration, func() bool { return true })
|
||||
|
||||
var logf logger.Logf = logger.Discard
|
||||
store := new(mem.Store)
|
||||
|
@@ -14,6 +14,7 @@ import (
|
||||
"tailscale.com/client/tailscale/apitype"
|
||||
"tailscale.com/hostinfo"
|
||||
"tailscale.com/ipn/ipnlocal"
|
||||
"tailscale.com/tstest"
|
||||
)
|
||||
|
||||
func TestValidHost(t *testing.T) {
|
||||
@@ -42,10 +43,7 @@ func TestValidHost(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSetPushDeviceToken(t *testing.T) {
|
||||
validLocalHostForTesting = true
|
||||
defer func() {
|
||||
validLocalHostForTesting = false
|
||||
}()
|
||||
tstest.Replace(t, &validLocalHostForTesting, true)
|
||||
|
||||
h := &Handler{
|
||||
PermitWrite: true,
|
||||
|
Reference in New Issue
Block a user