Commit b269ba27 authored by Tobias Klauser's avatar Tobias Klauser Committed by Brad Fitzpatrick

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: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 04b83988
......@@ -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)
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment