Commit Graph

37 Commits

Author SHA1 Message Date
benrubson
8d8506f2eb Correctly detect attr binary during tests 2017-06-25 13:22:45 +02:00
Johannes Bornhold
ea67ef11f5 Add check for reading the configuration from a pipe 2017-05-28 16:24:35 +02:00
benrubson
fc39c4dd20 Delete grow() test file
so that next tests do not depend on it
2017-04-13 20:20:57 +02:00
Ben RUBSON
efbdd29716 Allow read/write in standard reverse mode (#301) 2017-03-09 22:56:37 +01:00
Taylor Raack
10e26bf488 Resolve xattrs for symlinks (resolves #247, resolves #283) 2017-02-13 22:03:43 -08:00
Jakob Unterwurzacher
2b3e6031eb tests: open file with umask 0777
Regression test for https://github.com/vgough/encfs/issues/181

(fails at the moment, fixed in the next commits)
2016-06-25 14:47:16 +02:00
Jakob Unterwurzacher
a424a2155b tests: fix paths for new build path, add "test.sh" wrapper for usability
All tests pass at the moment.
2015-11-12 19:18:35 +01:00
Jakob Unterwurzacher
c3e63d7836 tests: fix "push on reference is experimental" warning
"tests/reverse.t.pl .. push on reference is experimental at tests/common.pl line 144."
2015-11-12 19:18:34 +01:00
Valient Gough
12e8efb2cd add test target 2015-06-15 23:48:14 -07:00
Jakob Unterwurzacher
31568b1de5 tests: Add benchmark-reverse.pl
Benchmarks "encfs --reverse" rsync performance.

Run "make benchmark-reverse" to run it with default settings.
2015-03-22 21:03:47 +01:00
Jakob Unterwurzacher
c58d311569 tests: Complain loudly when encfs segfaults while mounting
...instead of having all later tests fail with strange
error messages.
2015-03-20 00:12:51 +01:00
Jakob Unterwurzacher
21b3811f86 reverse mode: Disable unique IV by default
Commit 76424a58cb enabled unique IV
for reverse mode by default, to get more testing and to increase
security of reverse mode.

The downside is that all IVs change when the inode numbers change,
which means that all of the ciphertext changes.

This may bite people who copied the plaintext to a new filesystem
- they will find out that they have to rsync everything again.

This commit disables unique IV for reverse mode by default. It can
still be enabled through expert mode.
2015-03-16 08:31:25 +01:00
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