From de4153d9d2776a36e11469e1cb9a56d4c65349f9 Mon Sep 17 00:00:00 2001 From: Drew Malin Date: Tue, 19 May 2026 14:31:55 -0700 Subject: [PATCH 1/3] fix: update ssh port test --- pkg/cmd/util/externalnode_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/cmd/util/externalnode_test.go b/pkg/cmd/util/externalnode_test.go index c8521b83d..c842634ba 100644 --- a/pkg/cmd/util/externalnode_test.go +++ b/pkg/cmd/util/externalnode_test.go @@ -83,8 +83,8 @@ func TestResolveExternalNodeSSH_UsesServerPortNotPortNumber(t *testing.T) { Ports: []*nodev1.Port{ { Protocol: nodev1.PortProtocol_PORT_PROTOCOL_SSH, - PortNumber: 22, // well-known port — NOT what we connect to - ServerPort: 41920, // netbird-assigned port — this is correct + PortNumber: 41920, // netbird-assigned port — this is correct + ServerPort: 22, // well-known port — NOT what we connect to Hostname: strPtr("gateway.example.com"), }, }, From c82da6c9d91f19e6e90c26db6f32826c7a362b67 Mon Sep 17 00:00:00 2001 From: Drew Malin Date: Tue, 19 May 2026 14:42:26 -0700 Subject: [PATCH 2/3] fix --- pkg/cmd/refresh/refresh_test.go | 4 ++-- pkg/cmd/shell/shell_test.go | 4 ++-- pkg/cmd/util/externalnode_test.go | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pkg/cmd/refresh/refresh_test.go b/pkg/cmd/refresh/refresh_test.go index bf13a84ac..216e785d9 100644 --- a/pkg/cmd/refresh/refresh_test.go +++ b/pkg/cmd/refresh/refresh_test.go @@ -19,8 +19,8 @@ func TestResolveNodeSSHEntry_HappyPath(t *testing.T) { Ports: []*nodev1.Port{ { Protocol: nodev1.PortProtocol_PORT_PROTOCOL_SSH, - PortNumber: 22, - ServerPort: 41920, + PortNumber: 41920, + ServerPort: 22, Hostname: strPtr("10.0.0.5"), }, }, diff --git a/pkg/cmd/shell/shell_test.go b/pkg/cmd/shell/shell_test.go index 172e3b3c9..991ea9c49 100644 --- a/pkg/cmd/shell/shell_test.go +++ b/pkg/cmd/shell/shell_test.go @@ -22,8 +22,8 @@ func TestResolveExternalNodeSSH_BuildsCorrectInfo(t *testing.T) { Ports: []*nodev1.Port{ { Protocol: nodev1.PortProtocol_PORT_PROTOCOL_SSH, - PortNumber: 22, - ServerPort: 41920, + PortNumber: 41920, + ServerPort: 22, Hostname: strPtr("10.0.0.5"), }, }, diff --git a/pkg/cmd/util/externalnode_test.go b/pkg/cmd/util/externalnode_test.go index c842634ba..667972d64 100644 --- a/pkg/cmd/util/externalnode_test.go +++ b/pkg/cmd/util/externalnode_test.go @@ -32,7 +32,7 @@ func (m *mockExternalNodeStore) GetCurrentUser() (*entity.User, error) { func strPtr(s string) *string { return &s } -func makeTestNode(name, userID, linuxUser, hostname string, serverPort int32) *nodev1.ExternalNode { +func makeTestNode(name, userID, linuxUser, hostname string, portNumber int32) *nodev1.ExternalNode { return &nodev1.ExternalNode{ ExternalNodeId: "unode_test", Name: name, @@ -42,8 +42,8 @@ func makeTestNode(name, userID, linuxUser, hostname string, serverPort int32) *n Ports: []*nodev1.Port{ { Protocol: nodev1.PortProtocol_PORT_PROTOCOL_SSH, - PortNumber: 22, - ServerPort: serverPort, + PortNumber: portNumber, + ServerPort: 22, Hostname: &hostname, }, }, From 48fb5934eae774fcded4c81787702eaf817b2b54 Mon Sep 17 00:00:00 2001 From: Drew Malin Date: Tue, 19 May 2026 14:49:07 -0700 Subject: [PATCH 3/3] another one --- pkg/cmd/refresh/refresh_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/cmd/refresh/refresh_test.go b/pkg/cmd/refresh/refresh_test.go index 216e785d9..7c53b598c 100644 --- a/pkg/cmd/refresh/refresh_test.go +++ b/pkg/cmd/refresh/refresh_test.go @@ -53,8 +53,8 @@ func TestResolveNodeSSHEntry_UsesServerPortNotPortNumber(t *testing.T) { Ports: []*nodev1.Port{ { Protocol: nodev1.PortProtocol_PORT_PROTOCOL_SSH, - PortNumber: 22, // well-known port — NOT what we should connect to - ServerPort: 51234, // netbird-assigned port — correct + PortNumber: 51234, // netbird-assigned port — correct + ServerPort: 22, // well-known port — NOT what we should connect to Hostname: strPtr("gateway.example.com"), }, },