Commit 09e6b67a authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

nodefs: comment for cache_test.

parent 5e3fe891
......@@ -12,7 +12,6 @@ import (
"os"
"sync"
"testing"
"time"
"github.com/hanwen/go-fuse/fuse"
"github.com/hanwen/go-fuse/internal/testutil"
......@@ -83,10 +82,12 @@ func (r *keepCacheRoot) OnAdd(ctx context.Context) {
i.AddChild("nokeep", i.NewInode(ctx, r.nokeep, NodeAttr{}), true)
}
// Test FOPEN_KEEP_CACHE. This is a little subtle: the automatic cache
// invalidation triggers if mtime or file size is changed, so only
// change content but no metadata.
func TestKeepCache(t *testing.T) {
mntDir := testutil.TempDir()
defer os.RemoveAll(mntDir)
sec := time.Second
root := &keepCacheRoot{}
server, err := Mount(mntDir, root, &Options{
MountOptions: fuse.MountOptions{
......@@ -94,8 +95,7 @@ func TestKeepCache(t *testing.T) {
},
FirstAutomaticIno: 1,
AttrTimeout: &sec,
EntryTimeout: &sec,
// no caching.
})
defer server.Unmount()
c1, err := ioutil.ReadFile(mntDir + "/keep")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment