func CheckDirectoryEqual(d1, d2 string) error
CheckDirectoryEqual compares two directory paths to make sure that the content of the directories is the same.
func CheckDirectoryEqualWithApplier(root string, a Applier) error
CheckDirectoryEqualWithApplier compares directory against applier
func FSSuite(t *testing.T, a TestApplier)
FSSuite runs the path test suite
Applier applies single file changes
type Applier interface { Apply(root string) error }
func Apply(appliers ...Applier) Applier
Apply returns a new applier from the given appliers
func Base() Applier
func Chmod(name string, perm os.FileMode) Applier
Chmod returns a file applier which changes the file permission
func Chown(name string, uid, gid int) Applier
Chown returns a file applier which changes the ownership of a file
func Chtimes(name string, atime, mtime time.Time) Applier
Chtimes changes access and mod time of file. Use Lchtimes for symbolic links.
func CreateDir(name string, perm os.FileMode) Applier
CreateDir returns a file applier to create the directory with the provided name and permission
func CreateFile(name string, content []byte, perm os.FileMode) Applier
CreateFile returns a file applier which creates a file as the provided name with the given content and permission.
func CreateRandomFile(name string, seed, size int64, perm os.FileMode) Applier
CreateRandomFile returns a file applier which creates a file with random content of the given size using the given seed and permission.
func CreateSocket(name string, perm os.FileMode) Applier
func Lchtimes(name string, atime, mtime time.Time) Applier
Lchtimes changes access and mod time of file without following symlink
func Link(oldname, newname string) Applier
Link returns a file applier which creates a hard link
func Remove(name string) Applier
Remove returns a file applier which removes the provided file name
func RemoveAll(name string) Applier
RemoveAll returns a file applier which removes the provided file name as in os.RemoveAll
func Rename(old, new string) Applier
Rename returns a file applier which renames a file
func SetXAttr(name, key, value string) Applier
SetXAttr sets the xatter for the file
func Symlink(oldname, newname string) Applier
Symlink returns a file applier which creates a symbolic link
TestApplier applies the test context
type TestApplier interface { TestContext(context.Context) (context.Context, func(), error) Apply(context.Context, Applier) (string, func(), error) }