Documentation ¶
Overview ¶
Package vfstest provides tests for VFS.
Index ¶
- func FIXMETestWriteOpenFileInDirListing(t *testing.T)
- func RunTests(t *testing.T, useVFS bool, minimumRequiredCacheMode vfscommon.CacheMode, ...)
- func TestDirCacheFlush(t *testing.T)
- func TestDirCacheFlushOnDirRename(t *testing.T)
- func TestDirCreateAndRemoveDir(t *testing.T)
- func TestDirCreateAndRemoveFile(t *testing.T)
- func TestDirLs(t *testing.T)
- func TestDirModTime(t *testing.T)
- func TestDirRenameEmptyDir(t *testing.T)
- func TestDirRenameFile(t *testing.T)
- func TestDirRenameFullDir(t *testing.T)
- func TestFileModTime(t *testing.T)
- func TestFileModTimeWithOpenWriters(t *testing.T)
- func TestMount(t *testing.T)
- func TestReadByByte(t *testing.T)
- func TestReadChecksum(t *testing.T)
- func TestReadFileDoubleClose(t *testing.T)
- func TestReadSeek(t *testing.T)
- func TestRenameOpenHandle(t *testing.T)
- func TestRoot(t *testing.T)
- func TestTouchAndDelete(t *testing.T)
- func TestWriteFileAppend(t *testing.T)
- func TestWriteFileDoubleClose(t *testing.T)
- func TestWriteFileDup(t *testing.T)
- func TestWriteFileFsync(t *testing.T)
- func TestWriteFileNoWrite(t *testing.T)
- func TestWriteFileOverwrite(t *testing.T)
- func TestWriteFileWrite(t *testing.T)
- type Oser
- type Run
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FIXMETestWriteOpenFileInDirListing ¶
FIXMETestWriteOpenFileInDirListing tests open file in directory listing
func RunTests ¶
func RunTests(t *testing.T, useVFS bool, minimumRequiredCacheMode vfscommon.CacheMode, enableCacheTests bool, mountFn mountlib.MountFn)
RunTests runs all the tests against all the VFS cache modes
If useVFS is set then it runs the tests against a VFS rather than a mount
If useVFS is not set then it runs the mount in a subprocess in order to avoid kernel deadlocks.
func TestDirCacheFlush ¶
TestDirCacheFlush tests flushing the dir cache
func TestDirCacheFlushOnDirRename ¶
TestDirCacheFlushOnDirRename tests flushing the dir cache on rename
func TestDirCreateAndRemoveDir ¶
TestDirCreateAndRemoveDir tests creating and removing a directory
func TestDirCreateAndRemoveFile ¶
TestDirCreateAndRemoveFile tests creating and removing a file
func TestDirRenameEmptyDir ¶
TestDirRenameEmptyDir tests renaming and empty directory
func TestDirRenameFile ¶
TestDirRenameFile tests renaming a file
func TestDirRenameFullDir ¶
TestDirRenameFullDir tests renaming a full directory
func TestFileModTimeWithOpenWriters ¶
TestFileModTimeWithOpenWriters tests mod time on open files
func TestMount ¶
TestMount checks that the Fs is mounted by seeing if the mountpoint is in the mount output
func TestReadByByte ¶
TestReadByByte reads by byte including don't read any bytes
func TestReadChecksum ¶
TestReadChecksum checks the checksum reading is working
func TestReadFileDoubleClose ¶
TestReadFileDoubleClose tests double close on read
func TestRenameOpenHandle ¶
TestRenameOpenHandle checks that a file with open writers is successfully renamed after all writers close. See https://github.com/Evengard/rclone/issues/2130
func TestTouchAndDelete ¶
TestTouchAndDelete checks that writing a zero byte file and immediately deleting it is not racy. See https://github.com/Evengard/rclone/issues/1181
func TestWriteFileAppend ¶
TestWriteFileAppend tests that O_APPEND works on cache backends >= writes
func TestWriteFileDoubleClose ¶
TestWriteFileDoubleClose tests double close on write
func TestWriteFileDup ¶
TestWriteFileDup tests behavior of mmap() in Python by using dup() on a file handle
func TestWriteFileFsync ¶
TestWriteFileFsync tests Fsync
NB the code for this is in file.go rather than write.go
func TestWriteFileNoWrite ¶
TestWriteFileNoWrite tests writing a file with no write()'s to it
func TestWriteFileOverwrite ¶
TestWriteFileOverwrite tests overwriting a file
func TestWriteFileWrite ¶
TestWriteFileWrite tests writing a file and reading it back
Types ¶
type Oser ¶
type Oser interface { Chtimes(name string, atime time.Time, mtime time.Time) error Create(name string) (vfs.Handle, error) Mkdir(name string, perm os.FileMode) error Open(name string) (vfs.Handle, error) OpenFile(name string, flags int, perm os.FileMode) (fd vfs.Handle, err error) ReadDir(dirname string) ([]os.FileInfo, error) ReadFile(filename string) (b []byte, err error) Remove(name string) error Rename(oldName, newName string) error Stat(path string) (os.FileInfo, error) }
Oser defines the things that the "os" package can do
This covers what the VFS can do also