Browse Source

ssh/terminal: fix TestMakeRawState on iOS

Fix the following failure on iOS:

--- FAIL: TestMakeRawState (0.00s)
	terminal_test.go:332: failed to get terminal state from MakeRaw: operation not permitted

Updates golang/go#25535

Change-Id: I1ab6feb31ba5e89dc0d5f2a1cefd56c09f178e80
Reviewed-on: https://go-review.googlesource.com/114415
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Tobias Klauser 7 years ago
parent
commit
159ae71589
1 changed files with 6 additions and 0 deletions
  1. 6 0
      ssh/terminal/terminal_test.go

+ 6 - 0
ssh/terminal/terminal_test.go

@@ -10,6 +10,7 @@ import (
 	"bytes"
 	"io"
 	"os"
+	"runtime"
 	"testing"
 )
 
@@ -326,6 +327,11 @@ func TestMakeRawState(t *testing.T) {
 	if err != nil {
 		t.Fatalf("failed to get terminal state from GetState: %s", err)
 	}
+
+	if runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64") {
+		t.Skip("MakeRaw not allowed on iOS; skipping test")
+	}
+
 	defer Restore(fd, st)
 	raw, err := MakeRaw(fd)
 	if err != nil {