Skip to content

Commit

Permalink
fixing the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
thorstenkramm committed Aug 4, 2022
1 parent 585e323 commit 44fc35b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 0 additions & 2 deletions internal/pkg/controllers/tunnel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,6 @@ func TestTunnelCreateWithClientID(t *testing.T) {
expectedOutput := `{
"id": "123",
"client_id": "334",
"client_name": "",
"lhost": "lohost1",
"lport": "3300",
"rhost": "rhost2",
Expand Down Expand Up @@ -319,7 +318,6 @@ func TestTunnelCreateWithPortDiscovery(t *testing.T) {
expectedOutput := `{
"id": "777",
"client_id": "1313",
"client_name": "",
"lhost": "lohost44",
"lport": "",
"rhost": "",
Expand Down
18 changes: 10 additions & 8 deletions internal/pkg/output/tunnel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ func TestRenderTunnels(t *testing.T) {
{
Format: FormatHuman,
ExpectedOutput: `Tunnels
ID CLIENT ID CLIENT NAME LOCAL HOST LOCAL PORT REMOTE HOST REMOTE PORT LOCAL PORT RAND SCHEME ACL TIMEOUT
id22 lhost 123 rhost 124 false ssh 0.0.0.0 33
ID CLIENT ID CLIENT NAME LOCAL HOST LOCAL PORT REMOTE HOST REMOTE PORT LOCAL PORT RAND SCHEME ACL TIMEOUT
id22 RemoteMachine lhost 123 rhost 124 false ssh 0.0.0.0 33
`,
ColCountToGive: 150,
},
{
Format: FormatJSON,
ExpectedOutput: `[{"id":"id22","client_id":"","client_name":"","lhost":"lhost","lport":"123","rhost":"rhost","rport":"124","lport_random":false,"scheme":"ssh","acl":"0.0.0.0","idle_timeout_minutes":33}]
ExpectedOutput: `[{"id":"id22","client_id":"","client_name":"RemoteMachine","lhost":"lhost","lport":"123","rhost":"rhost","rport":"124","lport_random":false,"scheme":"ssh","acl":"0.0.0.0","idle_timeout_minutes":33}]
`,
ColCountToGive: 10,
},
Expand All @@ -36,7 +36,7 @@ id22 lhost 123 rhost 124 false
{
"id": "id22",
"client_id": "",
"client_name": "",
"client_name": "RemoteMachine",
"lhost": "lhost",
"lport": "123",
"rhost": "rhost",
Expand All @@ -54,7 +54,7 @@ id22 lhost 123 rhost 124 false
Format: FormatYAML,
ExpectedOutput: `- id: id22
client_id: ""
client_name: ""
client_name: RemoteMachine
local_host: lhost
local_port: "123"
remote_host: rhost
Expand All @@ -71,6 +71,7 @@ id22 lhost 123 rhost 124 false
tunnels := []*models.Tunnel{
{
ID: "id22",
ClientName: "RemoteMachine",
Lhost: "lhost",
Lport: "123",
Rhost: "rhost",
Expand Down Expand Up @@ -134,7 +135,7 @@ USAGE: ssh -p 123 123.22.22.33 -l root
},
{
Format: FormatJSON,
ExpectedOutput: `{"id":"id22","client_id":"","client_name":"","lhost":"lhost","lport":"123","rhost":"rhost","rport":"124","lport_random":false,"scheme":"ssh","acl":"0.0.0.0","usage":"ssh -p 123 123.22.22.33 -l root","idle_timeout_minutes":7}
ExpectedOutput: `{"id":"id22","client_id":"","client_name":"RemoteMachine","lhost":"lhost","lport":"123","rhost":"rhost","rport":"124","lport_random":false,"scheme":"ssh","acl":"0.0.0.0","usage":"ssh -p 123 123.22.22.33 -l root","idle_timeout_minutes":7}
`,
ColCountToGive: 10,
},
Expand All @@ -143,7 +144,7 @@ USAGE: ssh -p 123 123.22.22.33 -l root
ExpectedOutput: `{
"id": "id22",
"client_id": "",
"client_name": "",
"client_name": "RemoteMachine",
"lhost": "lhost",
"lport": "123",
"rhost": "rhost",
Expand All @@ -161,7 +162,7 @@ USAGE: ssh -p 123 123.22.22.33 -l root
Format: FormatYAML,
ExpectedOutput: `id: id22
client_id: ""
client_name: ""
client_name: RemoteMachine
local_host: lhost
local_port: "123"
remote_host: rhost
Expand All @@ -177,6 +178,7 @@ idle_timeout_minutes: 7
}
tunnel := &models.TunnelCreated{
ID: "id22",
ClientName: "RemoteMachine",
Lhost: "lhost",
Lport: "123",
Rhost: "rhost",
Expand Down

0 comments on commit 44fc35b

Please sign in to comment.