diff options
author | Jakob Unterwurzacher | 2020-07-11 20:15:47 +0200 |
---|---|---|
committer | Jakob Unterwurzacher | 2020-07-11 20:15:47 +0200 |
commit | b0342fae5d89301992d87f4305df71da502300ba (patch) | |
tree | 6625ace443592dd51216bddbd4125489cb9b3fd4 /internal/fusefrontend/openbackingdir_test.go | |
parent | 7de3330d70971c95562e8fa6db889cac2f17da36 (diff) |
v2api: fix TestOpenBackingDir
Diffstat (limited to 'internal/fusefrontend/openbackingdir_test.go')
-rw-r--r-- | internal/fusefrontend/openbackingdir_test.go | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/internal/fusefrontend/openbackingdir_test.go b/internal/fusefrontend/openbackingdir_test.go index 82cc74d..48c20d6 100644 --- a/internal/fusefrontend/openbackingdir_test.go +++ b/internal/fusefrontend/openbackingdir_test.go @@ -7,6 +7,8 @@ import ( "golang.org/x/sys/unix" + "github.com/hanwen/go-fuse/v2/fuse" + "github.com/rfjakob/gocryptfs/internal/syscallcompat" "github.com/rfjakob/gocryptfs/tests/test_helpers" ) @@ -17,14 +19,15 @@ func TestOpenBackingDir(t *testing.T) { Cipherdir: cipherdir, } fs := newTestFS(args) + out := &fuse.EntryOut{} - code := fs.Mkdir("dir1", 0700, nil) - if !code.Ok() { - t.Fatal(code) + _, errno := fs.Mkdir(nil, "dir1", 0700, out) + if errno != 0 { + t.Fatal(errno) } - code = fs.Mkdir("dir1/dir2", 0700, nil) - if !code.Ok() { - t.Fatal(code) + _, errno = fs.Mkdir(nil, "dir1/dir2", 0700, out) + if errno != 0 { + t.Fatal(errno) } dirfd, cName, err := fs.openBackingDir("") @@ -37,7 +40,7 @@ func TestOpenBackingDir(t *testing.T) { syscall.Close(dirfd) // Again, but populate the cache for "" by looking up a non-existing file - fs.GetAttr("xyz1234", nil) + fs.Getattr(nil, "xyz1234", &fuse.AttrOut{}) dirfd, cName, err = fs.openBackingDir("") if err != nil { t.Fatal(err) @@ -84,7 +87,7 @@ func TestOpenBackingDir(t *testing.T) { n255 := strings.Repeat("n", 255) path := "dir1/" + n255 - fs.Mkdir(path, 0700, nil) + fs.Mkdir(nil, path, 0700, out) dirfd, cName, err = fs.openBackingDir(path) if err != nil { t.Fatal(err) @@ -109,14 +112,15 @@ func TestOpenBackingDirPlaintextNames(t *testing.T) { PlaintextNames: true, } fs := newTestFS(args) + out := &fuse.EntryOut{} - code := fs.Mkdir("dir1", 0700, nil) - if !code.Ok() { - t.Fatal(code) + _, errno := fs.Mkdir(nil, "dir1", 0700, out) + if errno != 0 { + t.Fatal(errno) } - code = fs.Mkdir("dir1/dir2", 0700, nil) - if !code.Ok() { - t.Fatal(code) + _, errno = fs.Mkdir(nil, "dir1/dir2", 0700, out) + if errno != 0 { + t.Fatal(errno) } dirfd, cName, err := fs.openBackingDir("") |