vfstest

package
v1.66.1 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: MIT Imports: 31 Imported by: 0

Documentation

Overview

Package vfstest provides tests for VFS.

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, 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

func TestDirCacheFlush(t *testing.T)

TestDirCacheFlush tests flushing 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/artpar/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/artpar/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 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

Jump to

Keyboard shortcuts

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