diff options
| author | Anton Tolchanov <anton@tailscale.com> | 2025-09-17 14:41:58 +0100 |
|---|---|---|
| committer | Anton Tolchanov <anton@tailscale.com> | 2025-09-17 14:41:58 +0100 |
| commit | 604b8ef846cb2cb24cf55e73054683c379f8d924 (patch) | |
| tree | fde1a6b0ee0b2e4f4735690586cc32281cae0df8 | |
| parent | 03f5511342c84092ecfe170ede278aca803ba30e (diff) | |
| download | tailscale-knyar/serve-grants-headers.tar.xz tailscale-knyar/serve-grants-headers.zip | |
Populate nm.PacketFilter, use b.SetControlClientStatusknyar/serve-grants-headers
| -rw-r--r-- | ipn/ipnlocal/serve_test.go | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/ipn/ipnlocal/serve_test.go b/ipn/ipnlocal/serve_test.go index 38a58c51d..ef95559fd 100644 --- a/ipn/ipnlocal/serve_test.go +++ b/ipn/ipnlocal/serve_test.go @@ -23,10 +23,13 @@ import ( "path/filepath" "reflect" "strings" - "tailscale.com/types/views" "testing" "time" + "tailscale.com/control/controlclient" + "tailscale.com/types/views" + "tailscale.com/wgengine/filter" + "tailscale.com/health" "tailscale.com/ipn" "tailscale.com/ipn/store/mem" @@ -927,7 +930,7 @@ func newTestBackend(t *testing.T, opts ...any) *LocalBackend { pm.currentProfile = (&ipn.LoginProfile{ID: "id0"}).View() b.pm = pm - b.currentNode().SetNetMap(&netmap.NetworkMap{ + nm := &netmap.NetworkMap{ SelfNode: (&tailcfg.Node{ Name: "example.ts.net", Addresses: []netip.Prefix{ @@ -978,7 +981,13 @@ func newTestBackend(t *testing.T, opts ...any) *LocalBackend { }, }).View(), }, - }) + } + nm.PacketFilter, err = filter.MatchesFromFilterRules(nm.PacketFilterRules.AsSlice()) + if err != nil { + t.Fatal(err) + } + b.SetControlClientStatus(nil, controlclient.Status{NetMap: nm}) + return b } |
