MacOS: don't test symlinks longer than 1000 bytes

The limit is much lower than on Linux.

https://github.com/rfjakob/gocryptfs/issues/213
This commit is contained in:
Jakob Unterwurzacher 2018-02-28 20:40:08 +01:00
parent 90f2fea7fb
commit c5243fc79e
1 changed files with 6 additions and 0 deletions

View File

@ -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")