]> Cypherpunks repositories - gostls13.git/commitdiff
os: allow EROFS in TestMkdirAllAtSlash
authorRahul Chaudhry <rahulchaudhry@chromium.org>
Fri, 30 Jan 2015 23:07:11 +0000 (15:07 -0800)
committerIan Lance Taylor <iant@golang.org>
Fri, 30 Jan 2015 23:37:42 +0000 (23:37 +0000)
On some systems (e.g. ChromeOS), / is mounted read-only.
This results in error code syscall.EROFS, which I guess
is just as valid as syscall.EACCES for this test.

Change-Id: I9188d5437a1b5ac1daa9c68b95b8dcb447666ca3
Reviewed-on: https://go-review.googlesource.com/3676
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/os/path_test.go

index 6f24a43132a883e747e9119b300d41e0353bdfdb..bf7308a3eb6b4e952ea1137e64774eb3635ad85b 100644 (file)
@@ -211,7 +211,7 @@ func TestMkdirAllAtSlash(t *testing.T) {
        if err != nil {
                pathErr, ok := err.(*PathError)
                // common for users not to be able to write to /
-               if ok && pathErr.Err == syscall.EACCES {
+               if ok && (pathErr.Err == syscall.EACCES || pathErr.Err == syscall.EROFS) {
                        return
                }
                t.Fatalf(`MkdirAll "/_go_os_test/dir": %v`, err)