Skip to content
Merged
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
6 changes: 4 additions & 2 deletions cli/ssh_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1219,8 +1219,10 @@ func TestSSH(t *testing.T) {
// started and accepting input on stdin.
_ = pty.Peek(ctx, 1)

pty.WriteLine(fmt.Sprintf("netstat -an | grep -q %s; echo \"returned $?\"", remoteSock))
pty.ExpectMatchContext(ctx, "returned 0")
// This needs to support most shells on Linux or macOS
// We can't include exactly what's expected in the input, as that will always be matched
pty.WriteLine(fmt.Sprintf(`echo "results: $(netstat -an | grep %s | wc -l | tr -d ' ')"`, remoteSock))
pty.ExpectMatchContext(ctx, "results: 1")

// And we're done.
pty.WriteLine("exit")
Expand Down
Loading