summaryrefslogtreecommitdiff
path: root/internal/fusefrontend/xattr_unit_test.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2020-07-11 20:15:47 +0200
committerJakob Unterwurzacher2020-07-11 20:15:47 +0200
commitb0342fae5d89301992d87f4305df71da502300ba (patch)
tree6625ace443592dd51216bddbd4125489cb9b3fd4 /internal/fusefrontend/xattr_unit_test.go
parent7de3330d70971c95562e8fa6db889cac2f17da36 (diff)
v2api: fix TestOpenBackingDir
Diffstat (limited to 'internal/fusefrontend/xattr_unit_test.go')
-rw-r--r--internal/fusefrontend/xattr_unit_test.go35
1 files changed, 24 insertions, 11 deletions
diff --git a/internal/fusefrontend/xattr_unit_test.go b/internal/fusefrontend/xattr_unit_test.go
index b43aeb7..0a5e14a 100644
--- a/internal/fusefrontend/xattr_unit_test.go
+++ b/internal/fusefrontend/xattr_unit_test.go
@@ -5,28 +5,41 @@ package fusefrontend
import (
"testing"
+ "time"
+
+ "github.com/hanwen/go-fuse/v2/fs"
"github.com/rfjakob/gocryptfs/internal/contentenc"
"github.com/rfjakob/gocryptfs/internal/cryptocore"
"github.com/rfjakob/gocryptfs/internal/nametransform"
)
-func newTestFS(args Args) *FS {
+func newTestFS(args Args) *RootNode {
// Init crypto backend
key := make([]byte, cryptocore.KeyLen)
cCore := cryptocore.New(key, cryptocore.BackendGoGCM, contentenc.DefaultIVBits, true, false)
cEnc := contentenc.New(cCore, contentenc.DefaultBS, false)
- nameTransform := nametransform.New(cCore.EMECipher, true, true)
- return NewFS(args, cEnc, nameTransform)
+ n := nametransform.New(cCore.EMECipher, true, true)
+ rn := NewRootNode(args, cEnc, n)
+ oneSec := time.Second
+ options := &fs.Options{
+ EntryTimeout: &oneSec,
+ AttrTimeout: &oneSec,
+ }
+ fs.NewNodeFS(rn, options)
+ return rn
}
func TestEncryptDecryptXattrName(t *testing.T) {
- fs := newTestFS(Args{})
- attr1 := "user.foo123456789"
- cAttr := fs.encryptXattrName(attr1)
- t.Logf("cAttr=%v", cAttr)
- attr2, err := fs.decryptXattrName(cAttr)
- if attr1 != attr2 || err != nil {
- t.Fatalf("Decrypt mismatch: %v != %v", attr1, attr2)
- }
+ t.Fatal("not yet implemented")
+ /*
+ fs := newTestFS(Args{})
+ attr1 := "user.foo123456789"
+ cAttr := fs.encryptXattrName(attr1)
+ t.Logf("cAttr=%v", cAttr)
+ attr2, err := fs.decryptXattrName(cAttr)
+ if attr1 != attr2 || err != nil {
+ t.Fatalf("Decrypt mismatch: %v != %v", attr1, attr2)
+ }
+ */
}