diff options
| author | Jakob Unterwurzacher | 2026-02-08 21:37:09 +0100 |
|---|---|---|
| committer | Jakob Unterwurzacher | 2026-02-08 21:37:31 +0100 |
| commit | a5fd293b3981fad0cf2cc0f918e8c864fad2c961 (patch) | |
| tree | 537f8b3dfce6c03e366ce6712d61c363c6959c63 | |
| parent | c4ebaf18fa27256dfe708d93b7c07c53ad8f7c20 (diff) | |
tests/reverse: add TestXattrGetMountpoint
Fails right now:
gocryptfs/tests/reverse$ go test -run TestXattrGetMountpoint
--- FAIL: TestXattrGetMountpoint (0.00s)
xattr_test.go:78: LGet: xattr.get /var/tmp/gocryptfs-test-parent-1026/3269496664/x.3903415542.mnt user.foo453465324: invalid argument
xattr_test.go:82: LList: err=<nil>
FAIL
testcases[0] = struct { plaintextnames bool; deterministic_names bool }{plaintextnames:false, deterministic_names:false} failed
exit status 1
FAIL github.com/rfjakob/gocryptfs/v2/tests/reverse 0.091s
| -rw-r--r-- | tests/reverse/xattr_test.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/reverse/xattr_test.go b/tests/reverse/xattr_test.go index 406d055..b6a7b34 100644 --- a/tests/reverse/xattr_test.go +++ b/tests/reverse/xattr_test.go @@ -9,6 +9,7 @@ import ( "testing" "github.com/pkg/xattr" + "golang.org/x/sys/unix" ) func xattrSupported(path string) bool { @@ -65,3 +66,18 @@ func TestXattrList(t *testing.T) { } } } + +// Shouldn't get EINVAL when querying the mountpoint. +func TestXattrGetMountpoint(t *testing.T) { + _, err := xattr.LGet(dirB, "user.foo453465324") + if err == nil { + return + } + e2 := err.(*xattr.Error) + if e2.Unwrap() == unix.EINVAL { + t.Errorf("LGet: %v", err) + } + // Let's see what LList says + _, err = xattr.LList(dirB) + t.Logf("LList: err=%v", err) +} |
