Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions pkg/cmd/refresh/refresh_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
},
},
Expand Down Expand Up @@ -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"),
},
},
Expand Down
4 changes: 2 additions & 2 deletions pkg/cmd/shell/shell_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
},
},
Expand Down
10 changes: 5 additions & 5 deletions pkg/cmd/util/externalnode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
},
},
Expand Down Expand Up @@ -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"),
},
},
Expand Down
Loading