"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files
Go azure-blobazure-blob-storageazure-filesbackblaze-b2cloud-storagedropboxencryptionftpfuse-filesystemgogolanggoogle-cloud-storagegoogle-driveonedriveopenstack-swiftrclones3sftpsyncwebdav
mounttest: run the tests for all 4 VFS cache modes
Nick Craig-Wood57a5c6772929
diff --git a/cmd/cmount/mount.go b/cmd/cmount/mount.goindex bb481e8fd..8c482b53a 100644--- a/cmd/cmount/mount.go+++ b/cmd/cmount/mount.go@@ -129,6 +129,8 @@ func mount(f fs.Fs, mountpoint string) (*vfs.VFS, <-chan error, func() error, er// unmountunmount := func() error {+ // Shutdown the VFS+ fsys.VFS.Shutdown()fs.Debugf(nil, "Calling host.Unmount")if host.Unmount() {fs.Debugf(nil, "host.Unmount succeeded")diff --git a/cmd/mount/mount.go b/cmd/mount/mount.goindex 3896fa3a7..4e4bb38df 100644--- a/cmd/mount/mount.go+++ b/cmd/mount/mount.go@@ -100,6 +100,8 @@ func mount(f fs.Fs, mountpoint string) (*vfs.VFS, <-chan error, func() error, er}unmount := func() error {+ // Shutdown the VFS+ filesys.VFS.Shutdown()return fuse.Unmount(mountpoint)}diff --git a/cmd/mountlib/mounttest/fs.go b/cmd/mountlib/mounttest/fs.goindex 60b43707d..8302baf60 100644--- a/cmd/mountlib/mounttest/fs.go+++ b/cmd/mountlib/mounttest/fs.go@@ -19,6 +19,7 @@ import (_ "github.com/ncw/rclone/fs/all" // import all the file systems"github.com/ncw/rclone/fstest""github.com/ncw/rclone/vfs"+ "github.com/ncw/rclone/vfs/vfsflags""github.com/stretchr/testify/assert""github.com/stretchr/testify/require")@@ -38,9 +39,25 @@ var (func TestMain(m *testing.M, fn MountFn) {mountFn = fnflag.Parse()- run = newRun()- rc := m.Run()- run.Finalise()+ var rc int+ cacheModes := []vfs.CacheMode{+ vfs.CacheModeOff,+ vfs.CacheModeMinimal,+ vfs.CacheModeWrites,+ vfs.CacheModeFull,+ }+ for _, cacheMode := range cacheModes {+ vfsflags.Opt.CacheMode = cacheMode+ log.Printf("Starting test run with cache mode %v", cacheMode)+ run = newRun()+ rc = m.Run()+ run.Finalise()+ log.Printf("Finished test run with cache mode %v", cacheMode)+ if rc != 0 {+ break+ }+ }+ vfsflags.Opt.CacheMode = vfs.DefaultOpt.CacheModeos.Exit(rc)}@@ -147,6 +164,12 @@ func (r *Run) umount() {if err != nil {log.Fatalf("umount failed: %v", err)}++ // Cleanup the VFS cache - umount has called Shutdown+ err = r.vfs.CleanUp()+ if err != nil {+ log.Printf("Failed to cleanup the VFS cache: %v", err)+ }}func (r *Run) skipIfNoFUSE(t *testing.T) {