wgengine/router: split out from wgengine.

The router implementations are logically separate, with their own API.

Signed-off-by: David Anderson <danderson@tailscale.com>
This commit is contained in:
David Anderson
2020-04-30 13:20:09 -07:00
committed by Dave Anderson
parent ee3395e63a
commit 1ac570def7
16 changed files with 98 additions and 85 deletions

View File

@@ -10,6 +10,8 @@ import (
"strings"
"testing"
"time"
"tailscale.com/wgengine/router"
)
func TestWatchdog(t *testing.T) {
@@ -18,7 +20,7 @@ func TestWatchdog(t *testing.T) {
t.Run("default watchdog does not fire", func(t *testing.T) {
t.Parallel()
tun := NewFakeTun()
e, err := NewUserspaceEngineAdvanced(t.Logf, tun, NewFakeRouter, 0)
e, err := NewUserspaceEngineAdvanced(t.Logf, tun, router.NewFake, 0)
if err != nil {
t.Fatal(err)
}
@@ -35,7 +37,7 @@ func TestWatchdog(t *testing.T) {
t.Run("watchdog fires on blocked getStatus", func(t *testing.T) {
t.Parallel()
tun := NewFakeTun()
e, err := NewUserspaceEngineAdvanced(t.Logf, tun, NewFakeRouter, 0)
e, err := NewUserspaceEngineAdvanced(t.Logf, tun, router.NewFake, 0)
if err != nil {
t.Fatal(err)
}