aboutsummaryrefslogtreecommitdiff
path: root/tests/test_helpers
AgeCommit message (Collapse)Author
2020-05-09test_helpers: use new ctlsock.CtlSock APIJakob Unterwurzacher
2020-05-09test_helper: kill lsof after 1 secondJakob Unterwurzacher
lsof may get stuck when gocryptfs itself is stuck.
2020-05-09ctlsock: create exported ctlsock client libraryJakob Unterwurzacher
The former interal ctlsock server package is renamed to ctlsocksrv.
2020-05-09tests: use t.Name()Jakob Unterwurzacher
We did not use t.Name() as it was not available before Go 1.8. Now the oldest Go version we support is Go 1.11, so we can use it.
2019-11-16tests: also check inode number in VerifySizeJakob Unterwurzacher
Check Stat() vs Fstat() result. Not very useful at the moment as the kernel never seems to call Fstat().
2019-10-06tests: use /var/tmp by defaultJakob Unterwurzacher
On Fedora, /tmp is tmpfs, which behaves differently than ext4 (inode numbers are never reused, for example). Use /var/tmp, which is ext4 on Fedora, to get a more realistic test environment. This also allows us to drop the xattr workaround.
2019-10-06tests: filter leaked fds by prefixJakob Unterwurzacher
When running $ go test ./tests/matrix/ in isolation, it failed like this: fd leak? before, after: [0r=/dev/null 3w=/dev/null 5r=/proc/8078/fd (hidden:4)] [0r=/dev/null 3w=/dev/null 5w=/tmp/go-build366655199/b001/testlog.txt 7r=/proc/8078/fd (hidden:4)] Filter by prefix to get rid of this spurious test failure.
2019-10-06tests: clarify which process seems to be leaking fdsJakob Unterwurzacher
The tests check if they leak fds themselves, but we also check if gocryptfs leaks fds. Clarify what is what in the error message.
2019-09-08test_helpers: ListFds: handle an exited process gracefullyJakob Unterwurzacher
This used to dump a backtrace to the console which obscured what is going on.
2019-05-01tests: fix root_test permission issuesJakob Unterwurzacher
The parent directories need execute all permissions.
2019-05-01tests: split testParentDir by UIDJakob Unterwurzacher
When we run tests as root, they will leave root-owned files in testParentDir, which causes trouble when we run tests as a normal user later on. Split by UID.
2019-05-01test_helpers: better function comments for InitFS and MountJakob Unterwurzacher
It's confusing that you must pass "-extpass" for Mount but not for InitFS. Note that in the comment.
2019-01-20tests: check that we can delete directories with all permissionJakob Unterwurzacher
Regression test for https://github.com/rfjakob/gocryptfs/issues/354
2019-01-15tests: Increase timeout in Mount() function.Sebastian Lackner
This avoids sporadic test failures on macOS.
2019-01-14tests: reduce noise on MacOSJakob Unterwurzacher
This should get rid of Openat: O_NOFOLLOW missing: flags = 0x0 Fchmodat: adding missing AT_SYMLINK_NOFOLLOW flag sys_common_test.go:203: chmod on symlink should have failed, but did not. New mode=0333 UnmountErr: "[...]/057376762.mnt" was not found in MountInfo, cannot check for FD leak and add some context to --- FAIL: TestUtimesNano (0.00s) matrix_test.go:628: no such file or directory See https://github.com/rfjakob/gocryptfs/pull/343#issuecomment-453888006 for full test output
2019-01-05A few more spelling fixes.Sebastian Lackner
2019-01-04tests: bump maxCacheFds to 3Jakob Unterwurzacher
As the dirCache now has 3 entries, the tests should accept up to 3 extra fds without declaring an fd leak.
2019-01-04tests: fix VerifyExistence() helper, it missed unstat()able filesJakob Unterwurzacher
VerifyExistence missed unstat()able files in the directory listing because ioutil.ReadDir() filtered them out. https://github.com/rfjakob/gocryptfs/issues/285
2019-01-03Omit syscall.O_RDONLY flag when passing O_PATH.Sebastian Lackner
When O_PATH is specified in flags, flag bits other than O_CLOEXEC, O_DIRECTORY, and O_NOFOLLOW are ignored.
2019-01-03tests: allow one extra fd in fd leak detector (dirCache)Jakob Unterwurzacher
The gocryptfs process may keep one fd open for up to one second in the dirCache.
2019-01-03nametransform: simplify WriteDirIV to WriteDirIVAtJakob Unterwurzacher
Un-spaghettify the function and let the callers open the directory.
2019-01-02tests: retry longer when we see a fd leakJakob Unterwurzacher
Hopefully gets rid of the false positives on travis.
2019-01-02tests: add fd leak retry logic to UnmountErr, really return errorJakob Unterwurzacher
Give the gocryptfs process one extra millisecond to close files. Allows us to drop several other sleeps. UnmountErr now really returns an error when it detects an fd leak instead of just printing a message.
2019-01-02tests: ListFds(): filter out pipe and eventpoll fdsJakob Unterwurzacher
These are created on demand by the Go runtime and are usually not interesting.
2019-01-02tests: make MountInfo field accessibleJakob Unterwurzacher
Tests outside the test_helpers package may want to look at this.
2019-01-01tests: ListFds: show r/w statusJakob Unterwurzacher
Also, drop entries that disappear while we stat them.
2019-01-01tests: split mount_unmount.go from helpers.goJakob Unterwurzacher
With the FD leak logic, the mount/unmount functions have become complex enough to give them their own file.
2019-01-01tests: detect fd leaks on unmountJakob Unterwurzacher
For now, this only prints a message but does not fail the tests.
2019-01-01tests: teach ListFds() to check other processesJakob Unterwurzacher
2019-01-01tests: save gocryptfs process id in test_helpers.MountPIDJakob Unterwurzacher
This will allow to tests to monitor fd usage and maybe other things.
2018-10-10tests: respect TMPDIR if setJakob Unterwurzacher
Setting TMPDIR now allows to run the tests against a directory of your choice, making it easier to test different filesystems.
2018-09-23fusefrontend: get rid of os.File* wrappingJakob Unterwurzacher
Directly use int file descriptors for the dirfd and get rid of one level of indirection.
2018-08-11tests: VerifyExistence: panic on inconsistent resultsJakob Unterwurzacher
In the past we did not check whether all methods of checking the file return the same result. We should.
2018-06-07main: accept -dev, -nodev, -suid, -nosuid, -exec, -noexecJakob Unterwurzacher
When mounted via /etc/fstab like this, /a /b fuse.gocryptfs default 0 0 we always get extra options passed. As reported by @mahkoh at https://github.com/rfjakob/gocryptfs/pull/233 : mount passes `-o noexec` if `-o user` is set and `-o exec` is not set. If both `-o user` and `-o exec` are set, it passes `-o exec`. Make these options work, and in addtion, also make -suid and -rw work the same way. Reported-by: @mahkoh
2018-04-27tests: helpers: fix a few error reportsJakob Unterwurzacher
These were using stale err values.
2018-04-08Fix the easy golint warningsJakob Unterwurzacher
Reported by https://goreportcard.com/report/github.com/rfjakob/gocryptfs
2018-04-08tests: retry umountJakob Unterwurzacher
Gnome may still have files open causing spurious test failures.
2018-04-07tests: matrix: check for fd leaksJakob Unterwurzacher
And fix two in test_helpers.Mount(). Leftover fds can cause an unmount failure like this later: fusermount: failed to unmount /tmp/gocryptfs-test-parent/873632270/default-plain: Device or resource busy so try to catch them early.
2018-04-02fsck: add initial implementationJakob Unterwurzacher
Most corruption cases except xattr should be covered. With test filesystem. The output is still pretty ugly. xattr support will be added in the next commits.
2018-03-24test_helpers: add SwitchTestParentDirJakob Unterwurzacher
SwitchTestParentDir changes testParentDir. This is used when you want to perform tests on a special filesystem. For example, the xattr tests cannot run on tmpfs and use /var/tmp instead of /tmp.
2018-03-06tests: drop "-z" from fusermount to catch forgotten fdsJakob Unterwurzacher
macos does not have lazy unmount, so let's not use it on linux either. If the unmount fails, run "lsof" to find the open file. Also fix the first bug we found this way.
2018-03-05test_helpers: add missing newlineJakob Unterwurzacher
2018-02-28test_helpers: use an intermediate pipe for subprocess stdoutJakob Unterwurzacher
To Go test logic waits for stderr and stdout to close, so when we share it with a subprocess, it will wait for it to exit as well. We don't want the tests to hang when the unmount fails. Seen on MacOS as reported at https://github.com/rfjakob/gocryptfs/issues/213
2017-12-06tets_helpers: handle t=nil in InitFSJakob Unterwurzacher
The reverse tests call InitFS with t=nil. By calling panic we get a better error message instead of a generic nil pointer dereference.
2017-11-29fusefrontend: allow_other: close race between mkdir and chownSebastian Lackner
Fixes the same problem as described in 72b975867a3b9bdf53fc2da62e2ba4a328d7e4ab, except for directories instead of device nodes.
2017-05-07fusefrontend: implement path decryption via ctlsockJakob Unterwurzacher
Closes https://github.com/rfjakob/gocryptfs/issues/84 .
2017-05-07Fix typos found by MisspellJakob Unterwurzacher
Misspell Finds commonly misspelled English words gocryptfs/internal/configfile/scrypt.go Line 41: warning: "paramter" is a misspelling of "parameter" (misspell) gocryptfs/internal/ctlsock/ctlsock_serve.go Line 1: warning: "implementes" is a misspelling of "implements" (misspell) gocryptfs/tests/test_helpers/helpers.go Line 27: warning: "compatability" is a misspelling of "compatibility" (misspell)
2017-02-16tests: get rid of syscall.PathMaxJakob Unterwurzacher
Does not exist on OSX Reported in https://github.com/rfjakob/gocryptfs/issues/15
2017-02-15tests: use fuse-unmount.bashJakob Unterwurzacher
...instead of having separate compatability logic.
2016-11-26tests: don't call t.Fatal in checkExampleFSJakob Unterwurzacher
Calling t.Fatal means that the parent test has no chance to clean up.