]> Cypherpunks repositories - gostls13.git/commitdiff
os: skip Open("/") on Android
authorElias Naur <mail@eliasnaur.com>
Sun, 7 Apr 2019 18:00:39 +0000 (20:00 +0200)
committerElias Naur <mail@eliasnaur.com>
Sun, 7 Apr 2019 18:34:25 +0000 (18:34 +0000)
It's not supported in an app context:

$ go test -short os
--- FAIL: TestChdirAndGetwd (0.00s)
    os_test.go:1213: Open /: open /: permission denied

Change-Id: I56b951f925a50fd67715ee2f1de64951ee867e91
Reviewed-on: https://go-review.googlesource.com/c/go/+/170946
Run-TryBot: Elias Naur <mail@eliasnaur.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/os/os_test.go

index 1de46c29f50c30df734f321ffd6cd59fb663956c..b7e26f47b710e1e28014b54d1999c1f3619f4b3c 100644 (file)
@@ -1185,7 +1185,7 @@ func TestChdirAndGetwd(t *testing.T) {
        // /usr/bin does not usually exist on Plan 9 or Android.
        switch runtime.GOOS {
        case "android":
-               dirs = []string{"/", "/system/bin"}
+               dirs = []string{"/system/bin"}
        case "plan9":
                dirs = []string{"/", "/usr"}
        case "darwin":