From b269ba27edabbc65a34a9ccdcaca3744d43ac3c8 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Thu, 24 May 2018 23:57:27 +0200 Subject: [PATCH] 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 TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- unix/xattr_test.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/unix/xattr_test.go b/unix/xattr_test.go index fb846a7b..b8b28d0c 100644 --- a/unix/xattr_test.go +++ b/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) + } } }