mirror of
https://github.com/rclone/rclone.git
synced 2024-12-22 23:22:08 +01:00
ef2ef8ef84
Summary: In cases where cmount is not available in macOS, we alias nfsmount to mount command and transparently start the NFS server and mount it to the target dir. The NFS server is started on localhost on a random port so it is reasonably secure. Test Plan: ``` go run rclone.go mount --http-url https://beta.rclone.org :http: nfs-test ``` Added mount tests: ``` go test ./cmd/nfsmount ```
31 lines
890 B
Go
31 lines
890 B
Go
// Run the more functional vfstest package on the vfs
|
|
|
|
package vfs_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
_ "github.com/rclone/rclone/backend/all" // import all the backends
|
|
"github.com/rclone/rclone/cmd/mountlib"
|
|
"github.com/rclone/rclone/fstest"
|
|
"github.com/rclone/rclone/vfs"
|
|
"github.com/rclone/rclone/vfs/vfscommon"
|
|
"github.com/rclone/rclone/vfs/vfstest"
|
|
)
|
|
|
|
// TestExt runs more functional tests all the tests against all the
|
|
// VFS cache modes
|
|
func TestFunctional(t *testing.T) {
|
|
if *fstest.RemoteName != "" {
|
|
t.Skip("Skip on non local")
|
|
}
|
|
vfstest.RunTests(t, true, vfscommon.CacheModeOff, true, func(VFS *vfs.VFS, mountpoint string, opt *mountlib.Options) (unmountResult <-chan error, unmount func() error, err error) {
|
|
unmountResultChan := make(chan (error), 1)
|
|
unmount = func() error {
|
|
unmountResultChan <- nil
|
|
return nil
|
|
}
|
|
return unmountResultChan, unmount, nil
|
|
})
|
|
}
|