Skip to content

Commit

Permalink
ssh: Fix 'Listner' typo in createListnerAndSSHServer
Browse files Browse the repository at this point in the history
  • Loading branch information
cfergeau authored and praveenkumar committed Jun 16, 2022
1 parent 2d878c6 commit 33d028e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/crc/ssh/ssh_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func TestRunner(t *testing.T) {
clientKeyFile := filepath.Join(dir, "private.key")
writePrivateKey(t, clientKeyFile, clientKey)

cancel, runner, _ := createListnerAndSSHServer(t, clientKey, clientKeyFile)
cancel, runner, _ := createListenerAndSSHServer(t, clientKey, clientKeyFile)

assert.NoError(t, err)
defer runner.Close()
Expand All @@ -46,15 +46,15 @@ func TestRunner(t *testing.T) {
// Expect error when sending data over close ssh server channel
assert.Error(t, runner.CopyDataPrivileged([]byte(`hello world`), "/hello", 0644))

_, runner, totalConn := createListnerAndSSHServer(t, clientKey, clientKeyFile)
_, runner, totalConn := createListenerAndSSHServer(t, clientKey, clientKeyFile)
assert.NoError(t, runner.CopyDataPrivileged([]byte(`hello world`), "/hello", 0644))
assert.NoError(t, runner.CopyDataPrivileged([]byte(`hello world`), "/hello", 0644))
assert.NoError(t, runner.CopyDataPrivileged([]byte(`hello world`), "/hello", 0644))
assert.NoError(t, runner.CopyData([]byte(`hello world`), "/home/core/hello", 0644))
assert.Equal(t, 1, *totalConn)
}

func createListnerAndSSHServer(t *testing.T, clientKey *ecdsa.PrivateKey, clientKeyFile string) (context.CancelFunc, *Runner, *int) {
func createListenerAndSSHServer(t *testing.T, clientKey *ecdsa.PrivateKey, clientKeyFile string) (context.CancelFunc, *Runner, *int) {
listener, err := net.Listen("tcp", "127.0.0.1:")
require.NoError(t, err)
addr := listener.Addr().String()
Expand Down

0 comments on commit 33d028e

Please sign in to comment.