From 1f7c62cd66d3486a9cbcec5a4614c0414e9c8dab Mon Sep 17 00:00:00 2001 From: Nicola Murino Date: Wed, 16 Apr 2025 11:16:15 +0200 Subject: ssh/test: skip unsupported tests on js/wasm This fixes the build on the js/wasm builder. Change-Id: Icd891cd38b9da07279b9afaa168f7c64c81e13fe Reviewed-on: https://go-review.googlesource.com/c/crypto/+/665095 Auto-Submit: Nicola Murino LUCI-TryBot-Result: Go LUCI Reviewed-by: Dmitri Shuralyov Reviewed-by: Roland Shoemaker --- ssh/test/recording_client_test.go | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/ssh/test/recording_client_test.go b/ssh/test/recording_client_test.go index 4493e53..167dba9 100644 --- a/ssh/test/recording_client_test.go +++ b/ssh/test/recording_client_test.go @@ -13,6 +13,7 @@ import ( "os" "os/exec" "path/filepath" + "runtime" "strconv" "strings" "sync" @@ -232,8 +233,8 @@ func (test *clientTest) run(t *testing.T, write bool) { func recordingsClientConfig() *ssh.ClientConfig { config := clientConfig() - // Remove ML-KEM since it only works with Go 1.24. config.SetDefaults() + // Remove ML-KEM since it only works with Go 1.24. if config.KeyExchanges[0] == "mlkem768x25519-sha256" { config.KeyExchanges = config.KeyExchanges[1:] } @@ -322,6 +323,9 @@ func TestBannerCallback(t *testing.T) { } func TestRunCommandSuccess(t *testing.T) { + if runtime.GOARCH == "wasm" { + t.Skip("skipping test, executing a command, session.Run(), is not supported on wasm") + } test := clientTest{ name: "RunCommandSuccess", config: recordingsClientConfig(), @@ -361,6 +365,9 @@ func TestHostKeyCheck(t *testing.T) { } func TestRunCommandStdin(t *testing.T) { + if runtime.GOARCH == "wasm" { + t.Skip("skipping test, executing a command, session.Run(), is not supported on wasm") + } test := clientTest{ name: "RunCommandStdin", config: recordingsClientConfig(), @@ -387,6 +394,9 @@ func TestRunCommandStdin(t *testing.T) { } func TestRunCommandStdinError(t *testing.T) { + if runtime.GOARCH == "wasm" { + t.Skip("skipping test, executing a command, session.Run(), is not supported on wasm") + } test := clientTest{ name: "RunCommandStdinError", config: recordingsClientConfig(), @@ -414,6 +424,9 @@ func TestRunCommandStdinError(t *testing.T) { } func TestRunCommandFailed(t *testing.T) { + if runtime.GOARCH == "wasm" { + t.Skip("skipping test, executing a command, session.Run(), is not supported on wasm") + } test := clientTest{ name: "RunCommandFailed", config: recordingsClientConfig(), @@ -437,6 +450,9 @@ func TestRunCommandFailed(t *testing.T) { } func TestWindowChange(t *testing.T) { + if runtime.GOARCH == "wasm" { + t.Skip("skipping test, stdin/out are not supported on wasm") + } test := clientTest{ name: "WindowChange", config: recordingsClientConfig(), -- cgit v1.3