summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2022-06-26Fix typosYuta Hayashibe
2022-01-27root_test: fix leftover loop mountJakob Unterwurzacher
After running "make root_test" a few times df would look like this, no good: $ df Filesystem 1K-blocks Used Available Use% Mounted on [...] /dev/loop11 8729 8525 0 100% /tmp/gocryptfs-test-parent-0/4081611019/TestDiskFull.ext4.mnt /dev/loop12 8729 8525 0 100% /tmp/gocryptfs-test-parent-0/1959939106/TestDiskFull.ext4.mnt /dev/loop13 8729 8525 0 100% /tmp/gocryptfs-test-parent-0/2455888382/TestDiskFull.ext4.mnt /dev/loop14 8729 8525 0 100% /tmp/gocryptfs-test-parent-0/2002998275/TestDiskFull.ext4.mnt /dev/loop15 8729 8525 0 100% /var/tmp/gocryptfs-test-parent-0/806736609/TestDiskFull.ext4.mnt /dev/loop16 8729 8525 0 100% /tmp/gocryptfs-test-parent-0/4050106930/TestDiskFull.ext4.mnt /dev/loop17 8729 8525 0 100% /tmp/gocryptfs-test-parent-0/1661931756/TestDiskFull.ext4.mnt /dev/loop18 8729 8525 0 100% /tmp/gocryptfs-test-parent-0/617990718/TestDiskFull.ext4.mnt /dev/loop19 8729 8525 0 100% /tmp/gocryptfs-test-parent-0/3194420338/TestDiskFull.ext4.mnt /dev/loop20 8729 8525 0 100% /tmp/gocryptfs-test-parent-0/2180745159/TestDiskFull.ext4.mnt Turns out the unmount failed with EBUSY, so use lazy unmount.
2022-01-27root_test: add TestOverlay ; syscallcompat: add QuirkNoUserXattrJakob Unterwurzacher
2022-01-22tests: fix build failure on Go 1.15 and olderJakob Unterwurzacher
These don't have os.ReadDir yet. Error was: Error: vet: tests/defaults/overlayfs_test.go:104:15: ReadDir not declared by package os
2022-01-22tests: add skipped O_TMPFILE testJakob Unterwurzacher
Looks like the FUSE protocol does support O_TMPFILE yet. https://github.com/rfjakob/gocryptfs/issues/641
2022-01-22tests: add TestRenameWhiteout, TestRenameExchangeJakob Unterwurzacher
f
2022-01-22tests: enable -fusedebug if FUSEDEBUG env is setJakob Unterwurzacher
2022-01-10fusefrontend: fix -force_owner not affecting MKNODJakob Unterwurzacher
Fixes https://github.com/rfjakob/gocryptfs/issues/629
2022-01-04tests: improve SEEK_DATA test for MacOSJakob Unterwurzacher
(1) Create a 1 GiB file instead of 1 TiB, because apparently, on MacOS, the file (sometimes?) is not created sparse, and fills up users' disks: https://github.com/rfjakob/gocryptfs/issues/625 (2) On darwin, SEEK_DATA is not the same as on Linux ( https://github.com/golang/go/commit/2f8b555de27198775f9606e001ef19b76efdb415 ) so use the value provided by the unix package.
2022-01-03tests/cli: Check for leftover socket fileJakob Unterwurzacher
This fails at the moment: $ go test ./tests/cli/ --- FAIL: TestMountPasswordEmpty (0.01s) cli_test.go:430: socket file "/tmp/gocryptfs-test-parent-1026/3413782690/TestMountPasswordEmpty.753166857.sock" left behind https://github.com/rfjakob/gocryptfs/issues/634
2021-12-19fusefrontend: allow slashes in xattr namesJakob Unterwurzacher
xattr names have fewer restrictions than file names, relax the validation. Fixes https://github.com/rfjakob/gocryptfs/issues/627
2021-12-08root_test, getdents-debug: restrict to linuxJakob Unterwurzacher
This does not work neither make sense on MacOS.
2021-12-08tests: convert Creat() calls to Open()Jakob Unterwurzacher
Creat() is equivalent to Open(..., O_CREAT|O_WRONLY|O_TRUNC, ...) and MacOS does not have syscall.Creat(). https://github.com/rfjakob/gocryptfs/issues/623
2021-10-21cli: add -longnamemaxJakob Unterwurzacher
Fixes https://github.com/rfjakob/gocryptfs/issues/499
2021-10-15tests: add TestForceOwnerJakob Unterwurzacher
https://github.com/rfjakob/gocryptfs/issues/609 https://github.com/rfjakob/gocryptfs/pull/610
2021-09-08tests/matrix: test xchacha with and without opensslJakob Unterwurzacher
2021-09-01tests/matrix: don't leak fds in TestConcurrentReadCreateJakob Unterwurzacher
We leaked a file descriptor for each empty file we encountered.
2021-09-01*: trim trailing whitespacea1346054
2021-09-01shell scripts: fix shellcheck warningsa1346054
2021-08-30Unbreak hyperlinks broken by go mod v2 conversionJakob Unterwurzacher
Commit 69d88505fd7f4cb0d9e4f1918de296342fe05858 go mod: declare module version v2 translated all instances of "github.com/rfjakob/gocryptfs/" to "github.com/rfjakob/gocryptfs/v2/". Unfortunately, this included hyperlinks. Unbreak the hyperlinks like this: find . -name \*.go | xargs sed -i s%https://github.com/rfjakob/gocryptfs/v2/%https://github.com/rfjakob/gocryptfs/v2/%
2021-08-26fsstress-gocryptfs: fuse-xfstests now lives in /optJakob Unterwurzacher
fuse-xfstests should be installed to /opt now to make the terminal output independent of the user name (as done in https://github.com/rfjakob/fuse-xfstests/wiki/results_2021-06-02 )
2021-08-24tests/example_filesystems: add v2.2-xchacha-deterministic-namesJakob Unterwurzacher
Combines both new flags.
2021-08-24tests/example_filesystems: add deterministic-names and xchachaJakob Unterwurzacher
2021-08-23tests/cli: add -xchacha testsJakob Unterwurzacher
2021-08-23tests/matrix: add -xchacha testJakob Unterwurzacher
2021-08-23test/cli: actually run TestZerokeyJakob Unterwurzacher
As the filename did not end in _test.go, TestZerokey was not actually run. Fix that. renamed: tests/cli/zerokey.go -> tests/cli/zerokey_test.go
2021-08-23go mod: declare module version v2Jakob Unterwurzacher
Our git version is v2+ for some time now, but go.mod still declared v1. Hopefully making both match makes https://pkg.go.dev/github.com/rfjakob/gocryptfs/v2 work. All the import paths have been fixed like this: find . -name \*.go | xargs sed -i s%github.com/rfjakob/gocryptfs/%github.com/rfjakob/gocryptfs/v2/%
2021-08-20-deterministic-names: implement for reverse mode, tooJakob Unterwurzacher
2021-08-20-deterministic-names: accept flag on -initJakob Unterwurzacher
And store it in gocryptfs.conf (=remove DirIV feature flag).
2021-08-20Implement -deterministic-names: extended -zerodirivJakob Unterwurzacher
-deterministc-names uses all-zero dirivs but does not write them to disk anymore.
2021-08-19Flag -zerodiriv to create all diriv as all zero byte filesJose M Perez
2021-08-19golangci-lint: fix issues found by "unused" and "deadcode"Jakob Unterwurzacher
Except xattrSupported, this is a false positive. $ golangci-lint run --disable-all --enable unused --enable deadcode gocryptfs-xray/xray_main.go:24:5: `GitVersionFuse` is unused (deadcode) var GitVersionFuse = "[GitVersionFuse not set - please compile using ./build.bash]" ^ tests/symlink_race/main.go:47:6: `chmodLoop` is unused (deadcode) func chmodLoop() { ^ internal/readpassword/extpass_test.go:11:5: `testPw` is unused (deadcode) var testPw = []byte("test") ^ tests/reverse/xattr_test.go:13:6: func `xattrSupported` is unused (unused) func xattrSupported(path string) bool { ^ internal/fusefrontend_reverse/rpath.go:20:22: func `(*RootNode).abs` is unused (unused) func (rfs *RootNode) abs(relPath string, err error) (string, error) { ^ tests/matrix/matrix_test.go:310:6: `sContains` is unused (deadcode) func sContains(haystack []string, needle string) bool {
2021-08-19test_helpers: actually use global testParentDir variableJakob Unterwurzacher
Typo inside doInit.
2021-08-19Fix issues found by "go vet"Jakob Unterwurzacher
Issues were: # github.com/rfjakob/gocryptfs/contrib/findholes/holes contrib/findholes/holes/holes.go:136:2: unreachable code # github.com/rfjakob/gocryptfs/tests/root_test_test tests/root_test/root_test.go:139:2: unreachable code Also make sure we actually run "go vet" against the whole codebase.
2021-08-19golangci-lint: fix issues found by gosimpleJakob Unterwurzacher
Everything except the if err2.Err == syscall.EOPNOTSUPP case. Gets too confusing when collapsed into a single line. Issues were: $ golangci-lint run --disable-all --enable gosimple mount.go:473:2: S1008: should use 'return strings.HasPrefix(v, "fusermount version")' instead of 'if strings.HasPrefix(v, "fusermount version") { return true }; return false' (gosimple) if strings.HasPrefix(v, "fusermount version") { ^ cli_args.go:258:5: S1002: should omit comparison to bool constant, can be simplified to `args.forcedecode` (gosimple) if args.forcedecode == true { ^ cli_args.go:263:6: S1002: should omit comparison to bool constant, can be simplified to `args.aessiv` (gosimple) if args.aessiv == true { ^ cli_args.go:267:6: S1002: should omit comparison to bool constant, can be simplified to `args.reverse` (gosimple) if args.reverse == true { ^ internal/stupidgcm/stupidgcm.go:227:6: S1002: should omit comparison to bool constant, can be simplified to `g.forceDecode` (gosimple) if g.forceDecode == true { ^ gocryptfs-xray/xray_tests/xray_test.go:23:5: S1004: should use !bytes.Equal(out, expected) instead (gosimple) if bytes.Compare(out, expected) != 0 { ^ gocryptfs-xray/xray_tests/xray_test.go:40:5: S1004: should use !bytes.Equal(out, expected) instead (gosimple) if bytes.Compare(out, expected) != 0 { ^ gocryptfs-xray/paths_ctlsock.go:34:20: S1002: should omit comparison to bool constant, can be simplified to `!eof` (gosimple) for eof := false; eof == false; line++ { ^ tests/reverse/xattr_test.go:19:2: S1008: should use 'return err2.Err != syscall.EOPNOTSUPP' instead of 'if err2.Err == syscall.EOPNOTSUPP { return false }; return true' (gosimple) if err2.Err == syscall.EOPNOTSUPP { ^ internal/fusefrontend/node.go:459:45: S1002: should omit comparison to bool constant, can be simplified to `!nameFileAlreadyThere` (gosimple) if nametransform.IsLongContent(cName2) && nameFileAlreadyThere == false { ^ tests/xattr/xattr_integration_test.go:221:2: S1008: should use 'return err2.Err != syscall.EOPNOTSUPP' instead of 'if err2.Err == syscall.EOPNOTSUPP { return false }; return true' (gosimple) if err2.Err == syscall.EOPNOTSUPP { ^ tests/test_helpers/helpers.go:338:19: S1002: should omit comparison to bool constant, can be simplified to `open` (gosimple) if err != nil && open == true { ^ tests/matrix/concurrency_test.go:121:7: S1004: should use !bytes.Equal(buf, content) instead (gosimple) if bytes.Compare(buf, content) != 0 { ^
2021-08-18Fix issues found by ineffassignJakob Unterwurzacher
gocryptfs$ ineffassign ./... /home/jakob/go/src/github.com/rfjakob/gocryptfs/internal/configfile/config_file.go:243:2: ineffectual assignment to scryptHash /home/jakob/go/src/github.com/rfjakob/gocryptfs/internal/configfile/config_file.go:272:2: ineffectual assignment to scryptHash /home/jakob/go/src/github.com/rfjakob/gocryptfs/internal/fusefrontend/file.go:285:3: ineffectual assignment to fileID /home/jakob/go/src/github.com/rfjakob/gocryptfs/internal/fusefrontend/node.go:367:3: ineffectual assignment to err /home/jakob/go/src/github.com/rfjakob/gocryptfs/internal/fusefrontend/node_open_create.go:68:2: ineffectual assignment to fd /home/jakob/go/src/github.com/rfjakob/gocryptfs/mount.go:308:2: ineffectual assignment to masterkey /home/jakob/go/src/github.com/rfjakob/gocryptfs/gocryptfs-xray/xray_main.go:156:13: ineffectual assignment to err /home/jakob/go/src/github.com/rfjakob/gocryptfs/internal/fusefrontend/prepare_syscall_test.go:65:16: ineffectual assignment to errno /home/jakob/go/src/github.com/rfjakob/gocryptfs/internal/syscallcompat/open_nofollow_test.go:34:2: ineffectual assignment to fd /home/jakob/go/src/github.com/rfjakob/gocryptfs/tests/defaults/acl_test.go:111:6: ineffectual assignment to err /home/jakob/go/src/github.com/rfjakob/gocryptfs/tests/defaults/acl_test.go:181:2: ineffectual assignment to sz /home/jakob/go/src/github.com/rfjakob/gocryptfs/tests/defaults/acl_test.go:198:2: ineffectual assignment to sz /home/jakob/go/src/github.com/rfjakob/gocryptfs/tests/defaults/main_test.go:365:8: ineffectual assignment to err /home/jakob/go/src/github.com/rfjakob/gocryptfs/tests/xattr/xattr_fd_test.go:30:6: ineffectual assignment to err /home/jakob/go/src/github.com/rfjakob/gocryptfs/tests/xattr/xattr_fd_test.go:66:6: ineffectual assignment to err
2021-08-18reverse: fix "exclude all but" caseJakob Unterwurzacher
With test. Fixes https://github.com/rfjakob/gocryptfs/issues/588
2021-08-18tests/reverse/TestExcludeTestFs: test trailing slashJakob Unterwurzacher
2021-08-18tests/reverse/TestExcludeTestFs: improve comments & code styleJakob Unterwurzacher
No functional changes.
2021-08-17tests/cli/TestBadname: make sure case 5 is never decodableJakob Unterwurzacher
Sometimes, by chance, case 5 resulted in valid decrypted data: --- FAIL: TestBadname (0.08s) cli_test.go:885: Case 5 failed: "J7Rbo1BvfXojpBEr0Qrt_invalid_file GOCRYPTFS_BAD_NAME" in ["file GOCRYPTFS_BAD_NAME,\x9e$O\xc3j\x8c\xd0\x06\x01#\f%k\x02\xcanvalid_file GOCRYPTFS_BAD_NAME,mzaZRF9_0IU-_5vv2wPC_invalid_file GOCRYPTFS_BAD_NAME,file,file_invalid_file GOCRYPTFS_BAD_NAME,mzaZRF9_0IU-_5vv2wP_invalid_file GOCRYPTFS_BAD_NAME"] Add percent signs so base64 decoding always fails. Fixes https://github.com/rfjakob/gocryptfs/runs/3347883728
2021-08-16tests/reverse: replace os.ReadDir to support older Go versionsJakob Unterwurzacher
2021-08-16tests/root_test: show failing command detailJakob Unterwurzacher
https://github.com/kdave/btrfs-progs/issues/392
2021-08-16reverse mode: implement -one-file-systemJakob Unterwurzacher
Fixes https://github.com/rfjakob/gocryptfs/issues/475
2021-08-16tests/cli: escape filenames in TestBadname logsJakob Unterwurzacher
I just got this message (not reproducible) with unescaped binary garbage. UnmountErr: "/var/tmp/gocryptfs-test-parent-1026/114471933/TestMountBackground.899727687.mnt" was not found in MountInfo, cannot check for FD leaks UnmountErr: "/var/tmp/gocryptfs-test-parent-1026/114471933/TestConfigPipe.212912444.mnt" was not found in MountInfo, cannot check for FD leaks DecryptName "mzaZRF9_0IU-_5vv2wPC_i": unPad16 error: Padding too long, padLen=49 > 16 OpenDir ".": invalid entry "KqQ346cuOAFHv_qSta5PhAwrongPattern": bad message DecryptName "mzaZRF9_0IU-_5vv2wP_in": unPad16 error: Padding byte at i=10 is invalid --- FAIL: TestBadname (0.11s) cli_test.go:885: Case 5 failed: 'KqQ346cuOAFHv_qSta5P_invalid_file GOCRYPTFS_BAD_NAME' in [file_invalid_file GOCRYPTFS_BAD_NAME,file,mzaZRF9_0IU-_5vv2wPC_invalid_file GOCRYPTFS_BAD_NAME,file GOCRYPTFS_BAD_NAME,�*A���y���Gfnvalid_file GOCRYPTFS_BAD_NAME,mzaZRF9_0IU-_5vv2wP_invalid_file GOCRYPTFS_BAD_NAME] Invalid cipherdir: directory /var/tmp/gocryptfs-test-parent-1026/114471933/TestInitNotEmpty not empty FAIL FAIL github.com/rfjakob/gocryptfs/tests/cli 4.817s
2021-08-11syscallcompat: move quirks logic here & fix darwinJakob Unterwurzacher
We need to look at f_fstypename acc. to https://stackoverflow.com/a/52299141/1380267 : > As filesystem type numbers are now assigned at runtime in > recent versions of MacOS, you must use f_fstypename to > determine the type. https://github.com/rfjakob/gocryptfs/issues/585
2021-07-31fusefrontend: -sharedstorage: present stable inode numbersJakob Unterwurzacher
Use the Gen field (inode generation) to distinguish hard links while passing the real inode numbers to userspace. Fixes https://github.com/rfjakob/gocryptfs/issues/584
2021-07-31tests: matrix: add TestPwdJakob Unterwurzacher
https://github.com/rfjakob/gocryptfs/issues/584
2021-07-29fusefrontend: implement fsync on directoriesJakob Unterwurzacher
Fixes https://github.com/rfjakob/gocryptfs/issues/587
2021-06-27canonical-benchmarks.bash: handle relative pathsJakob Unterwurzacher
Passing a relative path was broken because we cd'ed away first.
2021-06-26tests/fsck: delete obsolete script run_fsck.bashJakob Unterwurzacher
Not called by anybody.