package fstest
import "github.com/containerd/continuity/fs/fstest"
Index ¶
- func CheckDirectoryEqual(d1, d2 string) error
- func CheckDirectoryEqualWithApplier(root string, a Applier) error
- func FSSuite(t *testing.T, a TestApplier)
- type Applier
- func Apply(appliers ...Applier) Applier
- func Base() Applier
- func Chmod(name string, perm os.FileMode) Applier
- func Chown(name string, uid, gid int) Applier
- func Chtimes(name string, atime, mtime time.Time) Applier
- func CreateDir(name string, perm os.FileMode) Applier
- func CreateFile(name string, content []byte, perm os.FileMode) Applier
- func CreateRandomFile(name string, seed, size int64, perm os.FileMode) Applier
- func CreateSocket(name string, perm os.FileMode) Applier
- func Lchtimes(name string, atime, mtime time.Time) Applier
- func Link(oldname, newname string) Applier
- func Remove(name string) Applier
- func RemoveAll(name string) Applier
- func Rename(old, new string) Applier
- func SetXAttr(name, key, value string) Applier
- func Symlink(oldname, newname string) Applier
- type TestApplier
Functions ¶
func CheckDirectoryEqual ¶
CheckDirectoryEqual compares two directory paths to make sure that the content of the directories is the same.
func CheckDirectoryEqualWithApplier ¶
CheckDirectoryEqualWithApplier compares directory against applier
func FSSuite ¶
func FSSuite(t *testing.T, a TestApplier)
FSSuite runs the path test suite
Types ¶
type Applier ¶
Applier applies single file changes
func Apply ¶
Apply returns a new applier from the given appliers
func Base ¶
func Base() Applier
func Chmod ¶
Chmod returns a file applier which changes the file permission
func Chown ¶
Chown returns a file applier which changes the ownership of a file
func Chtimes ¶
Chtimes changes access and mod time of file. Use Lchtimes for symbolic links.
func CreateDir ¶
CreateDir returns a file applier to create the directory with the provided name and permission
func CreateFile ¶
CreateFile returns a file applier which creates a file as the provided name with the given content and permission.
func CreateRandomFile ¶
CreateRandomFile returns a file applier which creates a file with random content of the given size using the given seed and permission.
func CreateSocket ¶
func Lchtimes ¶
Lchtimes changes access and mod time of file without following symlink
func Link ¶
Link returns a file applier which creates a hard link
func Remove ¶
Remove returns a file applier which removes the provided file name
func RemoveAll ¶
RemoveAll returns a file applier which removes the provided file name as in os.RemoveAll
func Rename ¶
Rename returns a file applier which renames a file
func SetXAttr ¶
SetXAttr sets the xatter for the file
func Symlink ¶
Symlink returns a file applier which creates a symbolic link
type TestApplier ¶
type TestApplier interface { TestContext(context.Context) (context.Context, func(), error) Apply(context.Context, Applier) (string, func(), error) }
TestApplier applies the test context
Source Files ¶
compare.go compare_unix.go continuity_util.go file.go file_unix.go testsuite.go
- Version
- v0.4.0
- Published
- May 17, 2023
- Platform
- js/wasm
- Imports
- 13 packages
- Last checked
- 12 hours ago –
Tools for package owners.