Explorar el Código

unix: fix TestXattr on android

Like on linux, lsetxattr on symlinks returns EPERM.

Change-Id: I6dfc59484e1826872af54579dd6ec02705c816da
Reviewed-on: https://go-review.googlesource.com/114535
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Tobias Klauser hace 7 años
padre
commit
b269ba27ed
Se han modificado 1 ficheros con 6 adiciones y 5 borrados
  1. 6 5
      unix/xattr_test.go

+ 6 - 5
unix/xattr_test.go

@@ -108,11 +108,12 @@ func TestXattr(t *testing.T) {
 		t.Fatal(err)
 	}
 
-	// Linux doesn't support xattrs on symlink according to xattr(7), so
-	// just test that we get the proper errors.
-
 	err = unix.Lsetxattr(s, xattrName, []byte(xattrDataSet), 0)
-	if err != nil && (runtime.GOOS != "linux" || err != unix.EPERM) {
-		t.Fatalf("Lsetxattr: %v", err)
+	if err != nil {
+		// Linux and Android doen't support xattrs on symlinks according
+		// to xattr(7), so just test that we get the proper error.
+		if (runtime.GOOS != "linux" && runtime.GOOS != "android") || err != unix.EPERM {
+			t.Fatalf("Lsetxattr: %v", err)
+		}
 	}
 }