summaryrefslogtreecommitdiff
path: root/internal/syscallcompat
diff options
context:
space:
mode:
authorJakob Unterwurzacher2018-10-11 19:45:47 +0200
committerJakob Unterwurzacher2018-10-11 19:45:47 +0200
commit57a5a8791f8a8c957aef87aecfa4fa318873b744 (patch)
tree7c46242becdab8f7ad9d4bf8363f3710f1d39160 /internal/syscallcompat
parent4f2feb1be7530d4fca7061b89d61f3ffc5761a0b (diff)
tests: syscallcompat: allow failure for symlinks > 1000
MacOS and old XFS versions do not support very long symlinks, but let's not make the tests fail because of that. https://github.com/rfjakob/gocryptfs/issues/267
Diffstat (limited to 'internal/syscallcompat')
-rw-r--r--internal/syscallcompat/sys_common_test.go11
1 files changed, 5 insertions, 6 deletions
diff --git a/internal/syscallcompat/sys_common_test.go b/internal/syscallcompat/sys_common_test.go
index 17268e4..e568a36 100644
--- a/internal/syscallcompat/sys_common_test.go
+++ b/internal/syscallcompat/sys_common_test.go
@@ -2,8 +2,6 @@ package syscallcompat
import (
"bytes"
- "os"
- "runtime"
"syscall"
"testing"
)
@@ -11,14 +9,15 @@ import (
func TestReadlinkat(t *testing.T) {
for _, targetLen := range []int{100, 500, 4000} {
target := string(bytes.Repeat([]byte("x"), targetLen))
- err := os.Symlink(target, tmpDir+"/readlinkat")
+ err := syscall.Symlink(target, tmpDir+"/readlinkat")
if err != nil {
- if targetLen > 1000 && runtime.GOOS == "darwin" {
+ if targetLen > 1000 {
// Symlinks longer than 1024 (?) bytes are not supported on
- // MacOS
+ // MacOS and XFS
+ t.Logf("skipping targetLen=%d: %v", targetLen, err)
continue
}
- t.Fatal(err)
+ t.Fatalf("targetLen=%d: %v", targetLen, err)
}
target2, err := Readlinkat(tmpDirFd, "readlinkat")
if err != nil {