summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2019-01-06tests: TestFallocate: comment what "d" and "h" meansJakob Unterwurzacher
Document what "d" and "h" means in the fancy ASCII diagrams. https://github.com/rfjakob/gocryptfs/pull/326
2019-01-05tests: add parallel_cp stress testJakob Unterwurzacher
Modeled after xfstests generic/273 https://github.com/rfjakob/gocryptfs/issues/322
2019-01-05fusefrontend: Allow to set/remove xattr on directory without read permission.Sebastian Lackner
Setting/removing extended attributes on directories was partially fixed with commit eff35e60b63331e3e10f921792baa10b236a721d. However, on most file systems it is also possible to do these operations without read access (see tests). Since we cannot open a write-access fd to a directory, we have to use the /proc/self/fd trick (already used for ListXAttr) for the other operations aswell. For simplicity, let's separate the Linux and Darwin code again (basically revert commit f320b76fd189a363a34bffe981aa67ab97df3362), and always use the /proc/self/fd trick on Linux. On Darwin we use the best-effort approach with openBackingFile() as a fallback. More discussion about the available options is available in https://github.com/rfjakob/gocryptfs/issues/308.
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-04fusefrontend: fix setting xattrs on directoriesJakob Unterwurzacher
Directories cannot be opened read-write. Retry with RDONLY.
2019-01-04tests: reverse: verify that longname .name files are exluded as wellJakob Unterwurzacher
Currently fails, will be fixed in the next commit. https://github.com/rfjakob/gocryptfs/issues/286
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-03tests: overengineer extractloop_plot_csv.m a littleJakob Unterwurzacher
Plot iteration time on second y axis, adjust line styles
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: extractloop: renice to level 19Jakob Unterwurzacher
Run at low priority to not annoy the user too much.
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: xattr: set on 0200 file, list on 0000 fileJakob Unterwurzacher
https://github.com/rfjakob/gocryptfs/issues/308
2019-01-02tests: better error message for TestBase64XattrReadJakob Unterwurzacher
Make clear what we have and what we want.
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-02tests: reverse: add ctlsocket cleanup delayJakob Unterwurzacher
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.
2019-01-01fusefrontend: xattr: fix hang on FIFOsJakob Unterwurzacher
An Open() a fifo blocks until it is opened for writing. This meant that xattr operations on FIFOs would block. Pass O_NONBLOCK to fix that, and add a test.
2019-01-01fusefrontend: make GetXAttr() symlink-safe on LinuxJakob Unterwurzacher
Uses the /proc/self/fd trick, which does not work on Darwin.
2019-01-01tests: add Flistxattr/Fgetxattr/Fremovexattr testsJakob Unterwurzacher
Test for the upcoming fd-based xattr support.
2019-01-01fusefrontend: make Access() symlink-safe.Jakob Unterwurzacher
Make Access() symlink-safe through use of faccessat.
2018-12-27Assorted spelling fixes.Sebastian Lackner
Mostly detected with the 'codespell' utility, but also includes some manual grammar fixes.
2018-10-11tests: fix golint errorJakob Unterwurzacher
Error was: tests/cli/cli_test.go:552: declaration of "err" shadows declaration at tests/cli/cli_test.go:544
2018-10-11tests: add idle timeout testJakob Unterwurzacher
Mount with idle timeout 10ms and check that the process exits by itself within 5 seconds.
2018-10-10tests: catch "name too long" symlink failure on XFSJakob Unterwurzacher
Retry with length 1000 if length 4000 fails, which should work on all filesystems. Failure was: --- FAIL: TestTooLongSymlink (0.00s) correctness_test.go:198: symlink xxx[...]xxxx /tmp/xfs.mnt/gocryptfs-test-parent/549823072/365091391/TooLongSymlink: file name too long https://github.com/rfjakob/gocryptfs/issues/267
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-09-23tests: add symlink_race toolJakob Unterwurzacher
Help uncover symlink races.
2018-09-22tests: detect and report chmod failures earlierJakob Unterwurzacher
Instead of reporting the consequence: matrix_test.go:906: modeHave 0664 != modeWant 0777 Report it if chmod itself fails, and also report the old file mode: matrix_test.go:901: chmod 000 -> 777 failed: bad file descriptor
2018-09-18main: sanitize commas from fsnameJakob Unterwurzacher
The cipherdir path is used as the fsname, as displayed in "df -T". Now, having a comma in fsname triggers a sanity check in go-fuse, aborting the mount with: /bin/fusermount: mount failed: Invalid argument fuse.NewServer failed: fusermount exited with code 256 Sanitize fsname by replacing any commas with underscores. https://github.com/rfjakob/gocryptfs/issues/262
2018-09-08fusefrontend: use OpenDirNofollow in openBackingDirJakob Unterwurzacher
Rename openBackingPath to openBackingDir and use OpenDirNofollow to be safe against symlink races. Note that openBackingDir is not used in several important code paths like Create(). But it is used in Unlink, and the performance impact in the RM benchmark to be acceptable: Before $ ./benchmark.bash Testing gocryptfs at /tmp/benchmark.bash.bYO: gocryptfs v1.6-12-g930c37e-dirty; go-fuse v20170619-49-gb11e293; 2018-09-08 go1.10.3 WRITE: 262144000 bytes (262 MB, 250 MiB) copied, 1.07979 s, 243 MB/s READ: 262144000 bytes (262 MB, 250 MiB) copied, 0.882413 s, 297 MB/s UNTAR: 16.703 MD5: 7.606 LS: 1.349 RM: 3.237 After $ ./benchmark.bash Testing gocryptfs at /tmp/benchmark.bash.jK3: gocryptfs v1.6-13-g84d6faf-dirty; go-fuse v20170619-49-gb11e293; 2018-09-08 go1.10.3 WRITE: 262144000 bytes (262 MB, 250 MiB) copied, 1.06261 s, 247 MB/s READ: 262144000 bytes (262 MB, 250 MiB) copied, 0.947228 s, 277 MB/s UNTAR: 17.197 MD5: 7.540 LS: 1.364 RM: 3.410
2018-09-08tests: restore Go 1.7 compatibilityJakob Unterwurzacher
Go 1.7 does not have t.Name() yet.
2018-09-08syscallcompat: use O_PATH in OpenDirNofollowJakob Unterwurzacher
This fixes the "0100 directory" problem in reverse mode, and should be slightly faster.
2018-09-08tests: add chmod testJakob Unterwurzacher
Makes sure we don't add regressions when fixing https://github.com/rfjakob/gocryptfs/issues/259
2018-09-08tests: restore TestUtimesNanoSymlinkJakob Unterwurzacher
The function seems to have been renamed by 426b9536 by mistake. Rename it back so the test is run again.
2018-09-08main: don't read the config file twice (fix pipe bug)Jakob Unterwurzacher
Instead, first Load() the file, then DecryptMasterKey(). Fixes https://github.com/rfjakob/gocryptfs/issues/258
2018-09-08configfile: add LoadAndDecrypt wrapperJakob Unterwurzacher
Callers that do not want to decrypt the masterkey should call plain Load(). https://github.com/rfjakob/gocryptfs/issues/258
2018-08-15main: add -e as an alias for -excludeJakob Unterwurzacher
2018-08-11reverse mode: add --exclude optionJakob Unterwurzacher
https://github.com/rfjakob/gocryptfs/issues/235
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-07-01fsck: handle sparse files efficiently, fix xfstests generic/285Jakob Unterwurzacher
If we encounter a 128KB block of zeros, try to skip to the next data section by calling File.SeekData(). This fixes xfstests generic/285, which creates a 17TB sparse file, and runs fsck afterwards. Without this optimization, fsck would take ages.
2018-07-01trezor: add TrezorPayloadJakob Unterwurzacher
TrezorPayload stores 32 random bytes used for unlocking the master key using a Trezor security module. The randomness makes sure that a unique unlock value is used for each gocryptfs filesystem.