mirror of
https://github.com/tailscale/tailscale.git
synced 2025-12-27 04:46:40 +00:00
feature/portmapper: make the portmapper & its debugging tools modular
Starting at a minimal binary and adding one feature back...
tailscaled tailscale combined (linux/amd64)
30073135 17451704 31543692 omitting everything
+ 480302 + 10258 + 493896 .. add debugportmapper
+ 475317 + 151943 + 467660 .. add portmapper
+ 500086 + 162873 + 510511 .. add portmapper+debugportmapper
Fixes #17148
Change-Id: I90bd0e9d1bd8cbe64fa2e885e9afef8fb5ee74b1
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
committed by
Brad Fitzpatrick
parent
2b0f59cd38
commit
99b3f69126
@@ -11,7 +11,7 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"tailscale.com/control/controlknobs"
|
||||
"tailscale.com/net/portmapper/portmappertype"
|
||||
"tailscale.com/util/eventbus/eventbustest"
|
||||
)
|
||||
|
||||
@@ -19,7 +19,7 @@ func TestCreateOrGetMapping(t *testing.T) {
|
||||
if v, _ := strconv.ParseBool(os.Getenv("HIT_NETWORK")); !v {
|
||||
t.Skip("skipping test without HIT_NETWORK=1")
|
||||
}
|
||||
c := NewClient(Config{Logf: t.Logf, ControlKnobs: new(controlknobs.Knobs)})
|
||||
c := NewClient(Config{Logf: t.Logf})
|
||||
defer c.Close()
|
||||
c.SetLocalPort(1234)
|
||||
for i := range 2 {
|
||||
@@ -35,7 +35,7 @@ func TestClientProbe(t *testing.T) {
|
||||
if v, _ := strconv.ParseBool(os.Getenv("HIT_NETWORK")); !v {
|
||||
t.Skip("skipping test without HIT_NETWORK=1")
|
||||
}
|
||||
c := NewClient(Config{Logf: t.Logf, ControlKnobs: new(controlknobs.Knobs)})
|
||||
c := NewClient(Config{Logf: t.Logf})
|
||||
defer c.Close()
|
||||
for i := range 3 {
|
||||
if i > 0 {
|
||||
@@ -50,7 +50,7 @@ func TestClientProbeThenMap(t *testing.T) {
|
||||
if v, _ := strconv.ParseBool(os.Getenv("HIT_NETWORK")); !v {
|
||||
t.Skip("skipping test without HIT_NETWORK=1")
|
||||
}
|
||||
c := NewClient(Config{Logf: t.Logf, ControlKnobs: new(controlknobs.Knobs)})
|
||||
c := NewClient(Config{Logf: t.Logf})
|
||||
defer c.Close()
|
||||
c.debug.VerboseLogs = true
|
||||
c.SetLocalPort(1234)
|
||||
@@ -150,7 +150,7 @@ func TestUpdateEvent(t *testing.T) {
|
||||
t.Fatalf("Probe failed: %v", err)
|
||||
}
|
||||
c.GetCachedMappingOrStartCreatingOne()
|
||||
if err := eventbustest.Expect(tw, eventbustest.Type[Mapping]()); err != nil {
|
||||
if err := eventbustest.Expect(tw, eventbustest.Type[portmappertype.Mapping]()); err != nil {
|
||||
t.Error(err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user