vfstest

package
v1.52.1-0...-9b21a15 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 7, 2020 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FIXMETestWriteOpenFileInDirListing

func FIXMETestWriteOpenFileInDirListing(t *testing.T)

FIXMETestWriteOpenFileInDirListing tests open file in directory listing

func RunTests

func RunTests(t *testing.T, useVFS bool, fn 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 amount

func TestDirCacheFlush

func TestDirCacheFlush(t *testing.T)

TestDirCacheFlush tests fluching the dir cache

func TestDirCacheFlushOnDirRename

func TestDirCacheFlushOnDirRename(t *testing.T)

TestDirCacheFlushOnDirRename tests flushing the dir cache on rename

func TestDirCreateAndRemoveDir

func TestDirCreateAndRemoveDir(t *testing.T)

TestDirCreateAndRemoveDir tests creating and removing a directory

func TestDirCreateAndRemoveFile

func TestDirCreateAndRemoveFile(t *testing.T)

TestDirCreateAndRemoveFile tests creating and removing a file

func TestDirLs

func TestDirLs(t *testing.T)

TestDirLs checks out listing

func TestDirModTime

func TestDirModTime(t *testing.T)

TestDirModTime tests mod times

func TestDirRenameEmptyDir

func TestDirRenameEmptyDir(t *testing.T)

TestDirRenameEmptyDir tests renaming and empty directory

func TestDirRenameFile

func TestDirRenameFile(t *testing.T)

TestDirRenameFile tests renaming a file

func TestDirRenameFullDir

func TestDirRenameFullDir(t *testing.T)

TestDirRenameFullDir tests renaming a full directory

func TestFileModTime

func TestFileModTime(t *testing.T)

TestFileModTime tests mod times on files

func TestFileModTimeWithOpenWriters

func TestFileModTimeWithOpenWriters(t *testing.T)

TestFileModTimeWithOpenWriters tests mod time on open files

func TestMount

func TestMount(t *testing.T)

TestMount checks that the Fs is mounted by seeing if the mountpoint is in the mount output

func TestReadByByte

func TestReadByByte(t *testing.T)

TestReadByByte reads by byte including don't read any bytes

func TestReadChecksum

func TestReadChecksum(t *testing.T)

TestReadChecksum checks the checksum reading is working

func TestReadFileDoubleClose

func TestReadFileDoubleClose(t *testing.T)

TestReadFileDoubleClose tests double close on read

func TestReadSeek

func TestReadSeek(t *testing.T)

TestReadSeek test seeking

func TestRenameOpenHandle

func TestRenameOpenHandle(t *testing.T)

TestRenameOpenHandle checks that a file with open writers is successfully renamed after all writers close. See https://github.com/rclone/rclone/issues/2130

func TestRoot

func TestRoot(t *testing.T)

TestRoot checks root directory is present and correct

func TestTouchAndDelete

func TestTouchAndDelete(t *testing.T)

TestTouchAndDelete checks that writing a zero byte file and immediately deleting it is not racy. See https://github.com/rclone/rclone/issues/1181

func TestWriteFileAppend

func TestWriteFileAppend(t *testing.T)

TestWriteFileAppend tests that O_APPEND works on cache backends >= writes

func TestWriteFileDoubleClose

func TestWriteFileDoubleClose(t *testing.T)

TestWriteFileDoubleClose tests double close on write

func TestWriteFileDup

func TestWriteFileDup(t *testing.T)

TestWriteFileDup tests behavior of mmap() in Python by using dup() on a file handle

func TestWriteFileFsync

func TestWriteFileFsync(t *testing.T)

TestWriteFileFsync tests Fsync

NB the code for this is in file.go rather than write.go

func TestWriteFileNoWrite

func TestWriteFileNoWrite(t *testing.T)

TestWriteFileNoWrite tests writing a file with no write()'s to it

func TestWriteFileOverwrite

func TestWriteFileOverwrite(t *testing.T)

TestWriteFileOverwrite tests overwriting a file

func TestWriteFileWrite

func TestWriteFileWrite(t *testing.T)

TestWriteFileWrite tests writing a file and reading it back

Types

type MountFn

type MountFn func(f fs.Fs, mountpoint string) (vfs *vfs.VFS, unmountResult <-chan error, unmount func() error, err error)

MountFn is called to mount the file system

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

type Run

type Run struct {
	// contains filtered or unexported fields
}

Run holds the remotes for a test run

func (*Run) Finalise

func (r *Run) Finalise()

Finalise cleans the remote and unmounts

type UnmountFn

type UnmountFn func() error

UnmountFn is called to unmount the file system

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL