Documentation ¶
Index ¶
- Constants
- Variables
- func Du(t *testing.T, fd int) (nBytes int64)
- func InitFS(t *testing.T, extraArgs ...string) string
- func Md5fn(filename string) string
- func Md5hex(buf []byte) string
- func Mount(c string, p string, showOutput bool, extraArgs ...string) error
- func MountOrExit(c string, p string, extraArgs ...string)
- func MountOrFatal(t *testing.T, c string, p string, extraArgs ...string)
- func QueryCtlSock(t *testing.T, socketPath string, req ctlsock.RequestStruct) (response ctlsock.ResponseStruct)
- func ResetTmpDir(createDirIV bool)
- func TestMkdirRmdir(t *testing.T, plainDir string)
- func TestRename(t *testing.T, plainDir string)
- func UnmountErr(dir string) error
- func UnmountPanic(dir string)
- func VerifyExistence(path string) bool
- func VerifySize(t *testing.T, path string, want int)
Constants ¶
const GocryptfsBinary = "../../gocryptfs"
GocryptfsBinary is the assumed path to the gocryptfs build.
const UnmountScript = "../fuse-unmount.bash"
UnmountScript is the fusermount/umount compatibility wrapper script
Variables ¶
var DefaultCipherDir string
DefaultCipherDir is TmpDir + "/default-cipher"
var DefaultPlainDir string
DefaultPlainDir is TmpDir + "/default-plain"
var TmpDir string
TmpDir is a unique temporary directory. "go test" runs package tests in parallel. We create a unique TmpDir in init() so the tests do not interfere.
var X255 string
X255 contains 255 uppercase "X". This can be used as a maximum-length filename.
Functions ¶
func Du ¶
Du returns the disk usage of the file "fd" points to, in bytes. Same as "du --block-size=1".
func InitFS ¶
InitFS calls "gocryptfs -init" on a new directory in TmpDir, passing "extraArgs" in addition to useful defaults.
The returned cipherdir has NO trailing slash.
func MountOrExit ¶
MountOrExit calls Mount() and exits on failure.
func MountOrFatal ¶
MountOrFatal calls Mount() and calls t.Fatal() on failure.
func QueryCtlSock ¶ added in v1.2.1
func QueryCtlSock(t *testing.T, socketPath string, req ctlsock.RequestStruct) (response ctlsock.ResponseStruct)
QueryCtlSock sends a request to the control socket at "socketPath" and returns the response.
func ResetTmpDir ¶
func ResetTmpDir(createDirIV bool)
ResetTmpDir deletes TmpDir, create new dir tree:
TmpDir |-- DefaultPlainDir *-- DefaultCipherDir
*-- gocryptfs.diriv
func TestMkdirRmdir ¶
TestMkdirRmdir creates and deletes a directory
func TestRename ¶
TestRename creates and renames a file
func UnmountErr ¶
UnmountErr tries to unmount "dir" and returns the resulting error.
func UnmountPanic ¶
func UnmountPanic(dir string)
UnmountPanic tries to umount "dir" and panics on error.
func VerifyExistence ¶
VerifyExistence checks in 3 ways that "path" exists: stat, open, readdir
Types ¶
This section is empty.