aboutsummaryrefslogtreecommitdiff
path: root/ssh/test/session_test.go
diff options
context:
space:
mode:
authorBryan C. Mills <bcmills@google.com>2024-01-05 18:21:50 -0500
committerGopher Robot <gobot@golang.org>2024-01-08 16:44:29 +0000
commitdbb6ec16ecef7a66638d8514be54b13660551b0a (patch)
tree166ea83dc8d6154b44a0f5349ce10289b517d11e /ssh/test/session_test.go
parent403f69900ed17a8c7dace8740fa0bed65ad19bbf (diff)
downloadgo-x-crypto-0.18.0.tar.xz
ssh/test: skip tests on darwin that fail on the darwin-amd64-longtest LUCI builderv0.18.0
We don't yet understand why these tests fail, but the Apple sshd seems to have some non-trivial vendor patches, so it is plausibly a platform-specific bug in the test. Let's skip that failure mode on the whole platform until/unless someone has time to reproduce and investigate the failure. For golang/go#64959. Cq-Include-Trybots: luci.golang.try:x_crypto-gotip-darwin-amd64-longtest,x_crypto-gotip-linux-amd64-longtest,x_crypto-gotip-windows-amd64-longtest Change-Id: I9e43579469de3fe9329c093b5916bbed0edd3751 Reviewed-on: https://go-review.googlesource.com/c/crypto/+/554077 Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Nicola Murino <nicola.murino@gmail.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Bryan Mills <bcmills@google.com>
Diffstat (limited to 'ssh/test/session_test.go')
-rw-r--r--ssh/test/session_test.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/ssh/test/session_test.go b/ssh/test/session_test.go
index 69c8b86..c128b2a 100644
--- a/ssh/test/session_test.go
+++ b/ssh/test/session_test.go
@@ -22,6 +22,13 @@ import (
"golang.org/x/crypto/ssh"
)
+func skipIfIssue64959(t *testing.T, err error) {
+ if err != nil && runtime.GOOS == "darwin" && strings.Contains(err.Error(), "ssh: unexpected packet in response to channel open: <nil>") {
+ t.Helper()
+ t.Skipf("skipping test broken on some versions of macOS; see https://go.dev/issue/64959")
+ }
+}
+
func TestRunCommandSuccess(t *testing.T) {
server := newServer(t)
conn := server.Dial(clientConfig())
@@ -29,6 +36,7 @@ func TestRunCommandSuccess(t *testing.T) {
session, err := conn.NewSession()
if err != nil {
+ skipIfIssue64959(t, err)
t.Fatalf("session failed: %v", err)
}
defer session.Close()
@@ -66,6 +74,7 @@ func TestRunCommandStdin(t *testing.T) {
session, err := conn.NewSession()
if err != nil {
+ skipIfIssue64959(t, err)
t.Fatalf("session failed: %v", err)
}
defer session.Close()
@@ -88,6 +97,7 @@ func TestRunCommandStdinError(t *testing.T) {
session, err := conn.NewSession()
if err != nil {
+ skipIfIssue64959(t, err)
t.Fatalf("session failed: %v", err)
}
defer session.Close()
@@ -111,6 +121,7 @@ func TestRunCommandFailed(t *testing.T) {
session, err := conn.NewSession()
if err != nil {
+ skipIfIssue64959(t, err)
t.Fatalf("session failed: %v", err)
}
defer session.Close()
@@ -127,6 +138,7 @@ func TestRunCommandWeClosed(t *testing.T) {
session, err := conn.NewSession()
if err != nil {
+ skipIfIssue64959(t, err)
t.Fatalf("session failed: %v", err)
}
err = session.Shell()
@@ -146,6 +158,7 @@ func TestFuncLargeRead(t *testing.T) {
session, err := conn.NewSession()
if err != nil {
+ skipIfIssue64959(t, err)
t.Fatalf("unable to create new session: %s", err)
}
@@ -182,6 +195,7 @@ func TestKeyChange(t *testing.T) {
for i := 0; i < 4; i++ {
session, err := conn.NewSession()
if err != nil {
+ skipIfIssue64959(t, err)
t.Fatalf("unable to create new session: %s", err)
}
@@ -223,6 +237,7 @@ func TestValidTerminalMode(t *testing.T) {
session, err := conn.NewSession()
if err != nil {
+ skipIfIssue64959(t, err)
t.Fatalf("session failed: %v", err)
}
defer session.Close()
@@ -287,6 +302,7 @@ func TestWindowChange(t *testing.T) {
session, err := conn.NewSession()
if err != nil {
+ skipIfIssue64959(t, err)
t.Fatalf("session failed: %v", err)
}
defer session.Close()
@@ -349,6 +365,7 @@ func testOneCipher(t *testing.T, cipher string, cipherOrder []string) {
// Exercise receiving data from the server
session, err := conn.NewSession()
if err != nil {
+ skipIfIssue64959(t, err)
t.Fatalf("NewSession: %v", err)
}