Commit Graph

62 Commits

Author SHA1 Message Date
Jakob Unterwurzacher
d25fcc6a4b reverse: gocryptfs.conf was missing from the directory listings
Fix the test for that and add checks in example_filesystems_test.
2016-10-08 22:25:08 +02:00
Jakob Unterwurzacher
79e3e28671 tests: add v1.1-reverse-plaintextnames example filesystem 2016-10-08 21:49:21 +02:00
Jakob Unterwurzacher
eb51a1ed20 tests: add v1.1-reverse example filesystem 2016-10-08 21:45:11 +02:00
Jakob Unterwurzacher
3c2c3453ad tests: add v1.1-aessiv example filesystem
Also move the example content into "content".
2016-10-08 21:45:01 +02:00
Jakob Unterwurzacher
f054353bd3 reverse: make gocryptfs.conf mapping plaintextnames-aware
Only in plaintextnames-mode AND with the config file at the
default location it will be mapped into the mountpoint.

Also adds a test for that.
2016-10-08 20:57:38 +02:00
Jakob Unterwurzacher
dde4a66454 tests: pass "-nosyslog"
We want to see panics and warnings on the console
2016-10-08 19:36:26 +02:00
Jakob Unterwurzacher
8c89e2da0c tests: invert ResetTmpDir argument
As reverse also does not want a diriv file, the "plaintextNames"
argument became a misnomer.
2016-10-08 19:22:59 +02:00
Jakob Unterwurzacher
29c8ca85d8 tests: matrix: have the testcase struct as a global variable
Future tests will need more info about the running test case.
2016-10-08 19:18:56 +02:00
Jakob Unterwurzacher
084cd597ab tests: matrix: convert to table-based style
And add AES-SIV
2016-10-08 19:16:05 +02:00
Jakob Unterwurzacher
434ce50db3 main: add "-nonempty" option 2016-10-06 22:41:13 +02:00
Valient Gough
b764917cd5 lint fixes 2016-10-04 23:18:33 +02:00
Jakob Unterwurzacher
db5782028a tests: skip tests with -openssl=false on Go 1.4 and lower
Go versions 1.4 and lower lack NewGCMWithNonceSize(), which causes
a panic in the test.
2016-10-04 22:34:12 +02:00
Jakob Unterwurzacher
67a959eebf tests: symlink to "/" instead of "/etc/motd"
This file does not exist on all systems, causing spurious
test failures.

See #40, #43
2016-10-04 22:01:47 +02:00
Jakob Unterwurzacher
95db38912b tests: fallocate: skip some disk usage checks on btrfs
The expected allocated sizes are verified for tmpfs and ext4.
btrfs gives different results, but that's not an error.

Also, simplify test_helpers.Du and several code paths.

Fixes #43.
2016-10-04 21:57:13 +02:00
Jakob Unterwurzacher
b068ffbff9 maxlen.bash: result was 1 too high
Additionally, output 0 instead of 7 on permission errors.
2016-10-04 10:26:22 +02:00
Jakob Unterwurzacher
e9bb8b800c reverse: switch from GCM-SIV to AES-SIV
GCM-SIV is not yet finalized, and the reference implemenation is
painfully slow at about 2 MB/s. Switch to AES-SIV.
2016-09-26 23:25:13 +02:00
Jakob Unterwurzacher
32e35adcad tests: add reverse linux tarball test 2016-09-25 20:04:03 +02:00
Jakob Unterwurzacher
5f4b16c00f Implement changes proposed by gosimple.
Also delete the unused "dirIVNameStruct", found by deadcode.
2016-09-25 19:48:21 +02:00
Jakob Unterwurzacher
b883dd10a6 reverse: add symlink encryption and Readlink support 2016-09-25 18:01:24 +02:00
Jakob Unterwurzacher
ffdb7cd47a reverse: more thorough longname stat test
Now also verifies the returned file size.
2016-09-25 16:43:17 +02:00
Jakob Unterwurzacher
2050c7f3b3 reverse: add gcmsiv flag and associated tests 2016-09-25 16:43:17 +02:00
Jakob Unterwurzacher
f8da264222 tests: smarter error handling in ResetTmpDir
Look at the error code from os.Remove and decide about the
right thing to do.

Gets rid of spurious fusermount error messages.
2016-09-25 16:43:17 +02:00
Jakob Unterwurzacher
6c52c1a6e6 reverse: add longname benchmark 2016-09-25 16:43:17 +02:00
Jakob Unterwurzacher
6ffd07f02a tests: extractloop: use tmp dir based on script name
This is how this should be done as well in future test scripts.
2016-09-25 16:43:17 +02:00
Jakob Unterwurzacher
f6d4d240e6 tests: skip the nanosecond compare for now 2016-09-25 16:42:29 +02:00
Jakob Unterwurzacher
8f1e51789d tests: set the times on a symlink
This currently fails as reported in
https://github.com/rfjakob/gocryptfs/issues/35 .

Also remove the spurious sleep in the test.
2016-09-25 16:17:26 +02:00
Jakob Unterwurzacher
fc0de96763 tests: add TestUtimesNano
Make sure setting nanoseconds works by path and fd.
2016-08-09 22:10:25 +02:00
Jakob Unterwurzacher
0a3225b1eb tests: add RSS tracking to extractloop
This obsoletes loopback-mem.bash.
2016-07-16 21:20:54 +02:00
Jakob Unterwurzacher
6b50f2debc tests: factor out fs-agnostic benchmark script
"canonical-benchmarks.bash TESTDIR"
can now be used on any filesystem.
2016-07-16 18:08:01 +02:00
Jakob Unterwurzacher
d3940c6263 tests: add maxlen.bash helper
Simple script that finds out the maximum supported filename
length.
2016-07-16 14:10:17 +02:00
Jakob Unterwurzacher
e98c51afd6 tests: add loopback-mem script
Helps to find memory leaks in go-fuse's loopback, which
gocryptfs builds upon.
2016-07-14 09:26:00 +02:00
Jakob Unterwurzacher
09c16ed2a7 tests: extractloop: add loopback support
loopback is an example app that comes with the go-fuse lib.
It uses all the same APIs as gocryptfs, minus the encryption.
2016-07-12 08:30:29 +02:00
Jakob Unterwurzacher
cf742f4e8b tests: add encfs support to benchmark.bash and extractloop.bash
Pass "-encfs" to test encfs instead of gocryptfs.
2016-07-11 22:10:41 +02:00
Jakob Unterwurzacher
63def5df5d tests: matrix: print name in verbose output 2016-07-11 21:42:40 +02:00
Jakob Unterwurzacher
df17f1d702 tests: add verbose output when unmounting 2016-07-11 20:41:53 +02:00
Jakob Unterwurzacher
1c54fcd04b tests: use unmount wrapper in ResetTmpDir
This should make it work on OSX.

Also, split unmount into two functions. Depending on what you
want,

* UnmountErr returns the resulting error
* UnmountPanic panics if the error was not nil
2016-07-11 20:41:16 +02:00
Jakob Unterwurzacher
7f3ede473e tests: fix shadow warning
"go tool vet -shadow=true" complained about the md5 package
being shadowed by variables called "md5".
Fix by using the Md5hex helper and dropping the md5 import.
2016-07-06 21:06:42 +02:00
Jakob Unterwurzacher
9d17fdb206 tests: OSX: cast st.Blksize to int64
On Linux, Blksize is already int64. But on OSX
it is int32 and that caused a compile failure.

https://github.com/rfjakob/gocryptfs/issues/15
2016-07-04 08:22:05 +02:00
Jakob Unterwurzacher
9b725c15cf syscallcompat: OSX: add Fallocate and Openat wrappers
...and convert all calls to syscall.{Fallocate,Openat}
to syscallcompat .

Both syscalls are not available on OSX. We emulate Openat and just
return EOPNOTSUPP for Fallocate.
2016-07-03 19:18:34 +02:00
Jakob Unterwurzacher
d5b7eb33da tests: call umount instead of fusermount on OSX
Reported at https://github.com/rfjakob/gocryptfs/issues/15
2016-07-02 20:06:20 +02:00
Jakob Unterwurzacher
54470baa23 fusefrontend: add fallocate support
Mode=0 (default) and mode=1 (keep size) are supported.
The patch includes test cases and the whole thing passed xfstests.

Fixes https://github.com/rfjakob/gocryptfs/issues/1 .
2016-07-02 19:52:09 +02:00
Jakob Unterwurzacher
f2b4d57068 fusefrontend: coalesce grows in Truncate()
We were growing the file block-by-block which was pretty
inefficient. We now coalesce all the grows into a single
Ftruncate. Also simplifies the code!

Simplistic benchmark: Before:

  $ time truncate -s 1000M foo
  real	0m0.568s

After:

  $ time truncate -s 1000M foo
  real	0m0.205s
2016-07-01 23:32:27 +02:00
Jakob Unterwurzacher
02b6d3067d test: split up integration_tests
...into "matrix" and "normal".

Also:
* Make running multiple packages in parallel safe, see
  http://stackoverflow.com/questions/23715302/go-how-to-run-tests-for-multiple-packages
* Don't depent on test_helper.TmpDir and friends to have a terminating slash
2016-06-30 00:57:14 +02:00
Jakob Unterwurzacher
f873d5f0a1 tests: run example_filesystems with "-openssl=false" AND "=true"
Run the tests twice, once with openssl and once with Go crypto.
2016-06-27 23:43:43 +02:00
Jakob Unterwurzacher
2720cd7b0d tests: give "-plaintextnames" its own test package
...and add tests for checking that gocryptfs.diriv
does not get created.

The main "integration_tests" package has become quite
big and convoluted over time.

This small separate package should make writing tests
for "-plaintextnames" easier.

As seen in "fusefrontend: fix PlaintextNames versions of Mkdir, Rmdir",
we need more of them.
2016-06-27 21:40:39 +02:00
Jakob Unterwurzacher
1de5ceed58 tests: add missing file "example_test_helpers.go"
This file was forgotten in commit
"tests: make tests for unsupported FSs more compact".
2016-06-26 18:34:30 +02:00
Jakob Unterwurzacher
b558901e66 Drop deprecated "-gcmiv128" option
The GCMIV128 feature flag is already mandatory, dropping the command
line option is the final step.

Completes https://github.com/rfjakob/gocryptfs/issues/29 .
2016-06-23 22:10:19 +02:00
Jakob Unterwurzacher
80fc3532f6 tests: make tests for unsupported FSs more compact
There is no need to test that deprecated command-line options
produce an error. I trust the flags package.

Also split the example_filesystem helper functions into a
separate file.
2016-06-23 22:03:45 +02:00
Jakob Unterwurzacher
3d59a72ba9 Drop deprecated "-emenames" option
The EMENames feature flag is already mandatory, dropping the command
line option is the final step.
2016-06-23 21:56:50 +02:00
Jakob Unterwurzacher
b17f0465c7 Drop deprecated "-diriv" option
The DirIV feature flag is already mandatory, dropping the command
line option is the final step.
2016-06-23 21:38:59 +02:00