From c5243fc79e25cd589e78f47dafe0e8144885e6e4 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Wed, 28 Feb 2018 20:40:08 +0100 Subject: MacOS: don't test symlinks longer than 1000 bytes The limit is much lower than on Linux. https://github.com/rfjakob/gocryptfs/issues/213 --- internal/syscallcompat/sys_common_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/syscallcompat/sys_common_test.go b/internal/syscallcompat/sys_common_test.go index bc694ba..17268e4 100644 --- a/internal/syscallcompat/sys_common_test.go +++ b/internal/syscallcompat/sys_common_test.go @@ -3,6 +3,7 @@ package syscallcompat import ( "bytes" "os" + "runtime" "syscall" "testing" ) @@ -12,6 +13,11 @@ func TestReadlinkat(t *testing.T) { target := string(bytes.Repeat([]byte("x"), targetLen)) err := os.Symlink(target, tmpDir+"/readlinkat") if err != nil { + if targetLen > 1000 && runtime.GOOS == "darwin" { + // Symlinks longer than 1024 (?) bytes are not supported on + // MacOS + continue + } t.Fatal(err) } target2, err := Readlinkat(tmpDirFd, "readlinkat") -- cgit v1.2.3