|
|
@ -5,7 +5,6 @@
|
|
|
|
package wgengine
|
|
|
|
package wgengine
|
|
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
import (
|
|
|
|
"bytes"
|
|
|
|
|
|
|
|
"fmt"
|
|
|
|
"fmt"
|
|
|
|
"reflect"
|
|
|
|
"reflect"
|
|
|
|
"testing"
|
|
|
|
"testing"
|
|
|
@ -15,6 +14,7 @@ import (
|
|
|
|
"tailscale.com/net/dns"
|
|
|
|
"tailscale.com/net/dns"
|
|
|
|
"tailscale.com/net/tstun"
|
|
|
|
"tailscale.com/net/tstun"
|
|
|
|
"tailscale.com/tailcfg"
|
|
|
|
"tailscale.com/tailcfg"
|
|
|
|
|
|
|
|
"tailscale.com/tstest"
|
|
|
|
"tailscale.com/tstime/mono"
|
|
|
|
"tailscale.com/tstime/mono"
|
|
|
|
"tailscale.com/types/key"
|
|
|
|
"tailscale.com/types/key"
|
|
|
|
"tailscale.com/types/netmap"
|
|
|
|
"tailscale.com/types/netmap"
|
|
|
@ -25,7 +25,7 @@ import (
|
|
|
|
|
|
|
|
|
|
|
|
func TestNoteReceiveActivity(t *testing.T) {
|
|
|
|
func TestNoteReceiveActivity(t *testing.T) {
|
|
|
|
now := mono.Time(123456)
|
|
|
|
now := mono.Time(123456)
|
|
|
|
var logBuf bytes.Buffer
|
|
|
|
var logBuf tstest.MemLogger
|
|
|
|
|
|
|
|
|
|
|
|
confc := make(chan bool, 1)
|
|
|
|
confc := make(chan bool, 1)
|
|
|
|
gotConf := func() bool {
|
|
|
|
gotConf := func() bool {
|
|
|
@ -37,11 +37,9 @@ func TestNoteReceiveActivity(t *testing.T) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
e := &userspaceEngine{
|
|
|
|
e := &userspaceEngine{
|
|
|
|
timeNow: func() mono.Time { return now },
|
|
|
|
timeNow: func() mono.Time { return now },
|
|
|
|
recvActivityAt: map[tailcfg.NodeKey]mono.Time{},
|
|
|
|
recvActivityAt: map[tailcfg.NodeKey]mono.Time{},
|
|
|
|
logf: func(format string, a ...interface{}) {
|
|
|
|
logf: logBuf.Logf,
|
|
|
|
fmt.Fprintf(&logBuf, format, a...)
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
tundev: new(tstun.Wrapper),
|
|
|
|
tundev: new(tstun.Wrapper),
|
|
|
|
testMaybeReconfigHook: func() { confc <- true },
|
|
|
|
testMaybeReconfigHook: func() { confc <- true },
|
|
|
|
trimmedNodes: map[tailcfg.NodeKey]bool{},
|
|
|
|
trimmedNodes: map[tailcfg.NodeKey]bool{},
|
|
|
|