Commit Graph

25 Commits

Author SHA1 Message Date
Jakob Unterwurzacher
5ef4ab0a41 reverse: re-enable kernel cache
Disabling the kernel cache make sure the encrypted view is always
up-to-date, however, it causes a factor 3 slowdown.
Please use --nocache manually if you want to disable caching.
Closes #60.

Also replaces the magic identifiers 513 and 514 by proper defines.
2015-03-15 17:54:56 +01:00
Jakob Unterwurzacher
b05872d85d tests: Use portable_unmount in reverse tests
Fixes unmount failure on OSX
2015-01-11 23:34:30 +01:00
Jakob Unterwurzacher
553f65a014 benchmark.pl: Improve help text, add Makefile target
Performing a benchmark on /var/tmp now is as easy as
"make benchmark".
2014-12-27 15:00:58 +01:00
Jakob Unterwurzacher
517c7bc948 benchmark.pl: Skip ecryptfs if mount.ecryptfs is not available
Allows the benchmark to work on OS X or when ecryptfs is not
installed.
Also, introduce stopwatch_start/stop helpers to cut down copy-paste
code.
2014-12-27 15:00:58 +01:00
Jakob Unterwurzacher
9a64ff97c5 benchmark.pl: Align numbers right in Markdown output 2014-12-08 19:34:50 +01:00
Jakob Unterwurzacher
9feb263dea tests: Add benchmark.pl - benchmark EncFS against eCryptfs
Example Results
* Seagate Barracuda 7200.9, model ST3250824AS
* Linux 3.16.3
* EncFS 1c5c75c44f

Test            | EncFS        | eCryptfs     | EncFS advantage
----------------|--------------|--------------|----------------
stream_write    |     32 MiB/s |     38 MiB/s | 0.84
extract         |  28744 ms    |  30027 ms    | 1.04
du              |    495 MB    |    784 MB    | 1.58
rsync           |   3319 ms    |  62486 ms    | 18.83
delete          |   6462 ms    |  74652 ms    | 11.55

(eCryptfs is very slow for stat() on a classical HDD)
2014-12-08 18:09:20 +01:00
Jakob Unterwurzacher
1c5c75c44f tests: Name all tests ".t.pl"
This way, everything (for example, common.inc) can have its proper
".pl" ending and syntax highlighting works properly in every editor.
2014-12-08 17:39:10 +01:00
Jakob Unterwurzacher
8b8130782d tests: Unset ENCFS6_CONFIG before testing
This prevents unexpected failures when you have set that variable.

Also, give Test::More the number of tests that will be run for
more informative output.
2014-11-30 23:13:10 +01:00
Jakob Unterwurzacher
91919929dd tests: reverse: symlink absolute path inside the plaintext dir
This test currently fails because of a bug in EncFS
2014-11-30 22:22:20 +01:00
Jakob Unterwurzacher
32102447e0 reverse: Filesystem is read-only of uniqueIV is enabled
Writing to the ciphertext files can rewrite the header. This
would mean we had to re-encrypt the whole file with the new IV.

This could be made more fine-grained, for example allowing
writes to everywhere but the header. However, this is
something that needs a lot of testing to ensure correctness.
Writing to the ciphertext is a niche use case of the niche
use case of using reverse mode, so it is unlikely it would
get the test coverage it needs.

To be safe, we deny all modifications of the ciphertext with
read-only filesystem error (EROFS) if uniqueIV is enabled.

Reverse mode with uniqueIV disabled still supports writing,
if somebody really needs it. This use case is not covered
by the test suite at the moment.
2014-11-30 14:23:35 +01:00
Jakob Unterwurzacher
7732466277 tests: Replace calls to dd with native writeZeroes 2014-11-29 13:35:02 +01:00
Jakob Unterwurzacher
43a1cd3344 tests: Get rid of df warnings
Like "Transport endpoint is not connected" when there is
a stale FUSE mount lying around
2014-11-23 21:17:27 +01:00
Jakob Unterwurzacher
1b5cde2273 tests: Also verify file contents in grow test 2014-11-23 18:24:55 +01:00
Jakob Unterwurzacher
76424a58cb Implement uniqueIV for reverse mode
For now, the IVs are constant. This is fixed in a later commit.
They are enabled by default to make testing easier.
The whole thing passes the test suite on x86 and x86_64.
2014-11-23 18:24:22 +01:00
Jakob Unterwurzacher
dee3f628e3 Implement --nocache
Disable block cache (in EncFS) and stat cache (in kernel).
This is needed if the backing files may be modified
behind the back of EncFS (for example, when you mount
an encrypted filesystem exported by encfs --reverse).

The reverse grow tests fail when this option is not passed to the
decrypting mount.
2014-11-17 21:57:06 +01:00
Jakob Unterwurzacher
6d895fdc72 tests: Add --reverse file grow test
This test uncovered issues caused by unsafe kernel-side and BlockFileIO caching.
2014-11-17 00:39:14 +01:00
Jakob Unterwurzacher
a00a3beb8e tests: explicitely verify that the reverse mount worked 2014-11-17 00:32:54 +01:00
Jakob Unterwurzacher
b2943eeed1 tests: Move helper funtion to common.inc
Also fixes md5fh's fd leak.
2014-11-17 00:32:54 +01:00
Jakob Unterwurzacher
8efda5b700 tests: Check that absolute symlinks work in reverse mode 2014-11-04 23:08:33 +01:00
Valient Gough
19aba9fa77 reduce boost dependencies
enables c++11 mode on GCC
also fix soft links to root paths in reverse mode
2014-10-26 10:23:10 -07:00
Jakob Unterwurzacher
7e03b6d2c5 tests: Add reverse mode tests 2014-10-21 22:13:36 +02:00
Jakob Unterwurzacher
6adc1e4a8f tests: Always run unit tests 2014-10-20 20:55:13 +02:00
Jakob Unterwurzacher
0e8e1dd20c tests: Move perl tests to tests/, make them callable from top-level Makefile
Use "make test" or "make test-verbose" to run.
Note that "make test" seems to be more common than "make tests", hence the
change.

Also, use a new clean directory directory as a working area for each run
Created using mkdtemp and deleted in cleanup()
2014-10-20 20:55:02 +02:00
Jakob Unterwurzacher
38970c75bd tests: Port bash tests to perl
This integrates the tests written in bash into the existing perl infrastructure.
2014-10-20 20:46:29 +02:00
Jakob Unterwurzacher
8bda1c8a46 tests: Add integration tests
Add a simple cli-based test infrastructure with a few tests
to prepare future code changes.
Note that these cannot be run on Travis CI as it does not support
FUSE.

Expected output:

	$ tests/run.sh
	1 Running unit tests: OK
	*** running test_corruption.sh
	2 Reading file: OK
	3 Reading corrupted file: OK
	4 Reading file with MAC: OK
	5 Corruption with MAC returns IO error: OK
	*** running test_file_expansion.sh
	6 Creating files of different sizes: : OK
	7 Growing file: OK
	8 Internal modification: OK
	*** All tests OK
2014-10-17 19:41:21 +02:00