Commit Graph

36 Commits

Author SHA1 Message Date
Jakob Unterwurzacher
f270135c16 test_helper: VerifyExistence: don't panic
Instead bubble up the error to the testing object.
2020-08-15 15:39:08 +02:00
Jakob Unterwurzacher
7dda2363e1 Fix "go get" failure
Move the statusTxtContent to fix this confusing error
when running `go get github.com/rfjakob/gocryptfs/...`:

  $ go get github.com/rfjakob/gocryptfs/...
  # github.com/rfjakob/gocryptfs/tests/example_filesystems
  tests/example_filesystems/example_test_helpers.go:22:16: undefined: statusTxtContent
  tests/example_filesystems/example_test_helpers.go:75:16: undefined: statusTxtContent
2019-12-24 00:38:40 +01:00
Sebastian Lackner
874eaf9734 Assorted spelling fixes.
Mostly detected with the 'codespell' utility, but also includes some
manual grammar fixes.
2018-12-27 15:19:55 +01:00
Jakob Unterwurzacher
fc8fca04a8 tests: example_filesystems: create a private copy in /tmp
The tests write to the example_filesystems folder, which
1) May leave your source tree in a modified state
2) Triggers test failures when the fsck tests run concurrently,
   which happens on Travis CI every now and then.

Fix both problem by copying the example_filesystems folder
to a private location in /tmp.
2018-05-04 22:27:59 +02:00
Jakob Unterwurzacher
9bc039a4ba Add -masterkey=stdin functionality
https://github.com/rfjakob/gocryptfs/issues/218
2018-03-22 00:02:10 +01:00
Sebastian Lackner
d257bb34c1 tests: Add test for access to encrypted version of '.' and '..'
To show that https://github.com/rfjakob/gocryptfs/issues/163 has been fixed.
2017-11-23 08:48:00 +01:00
Jakob Unterwurzacher
4da245c69d fusefrontend_reverse: fix 176-byte names
A file with a name of exactly 176 bytes length caused this error:

  ls: cannot access ./tmp/dsg/sXSGJLTuZuW1FarwIkJs0w/b6mGjdxIRpaeanTo0rbh0A/QjMRrQZC_4WLhmHI1UOBcA/gocryptfs.longname.QV-UipdDXeUVdl05WruoEzBNPrQCfpu6OzJL0_QnDKY: No such file or directory
  ls: cannot access ./tmp/dsg/sXSGJLTuZuW1FarwIkJs0w/b6mGjdxIRpaeanTo0rbh0A/QjMRrQZC_4WLhmHI1UOBcA/gocryptfs.longname.QV-UipdDXeUVdl05WruoEzBNPrQCfpu6OzJL0_QnDKY.name: No such file or directory
  -????????? ? ?     ?             ?            ? gocryptfs.longname.QV-UipdDXeUVdl05WruoEzBNPrQCfpu6OzJL0_QnDKY
  -????????? ? ?     ?             ?            ? gocryptfs.longname.QV-UipdDXeUVdl05WruoEzBNPrQCfpu6OzJL0_QnDKY.name

Root cause was a wrong shortNameMax constant that failed to
account for the obligatory padding byte.

Fix the constant and also expand the TestLongnameStat test case
to test ALL file name lengths from 1-255 bytes.

Fixes https://github.com/rfjakob/gocryptfs/issues/143 .
2017-10-01 13:50:25 +02:00
Jakob Unterwurzacher
e43eb36da3 tests: add v1.3-reverse example filesystem
We check the md5 sum of the encrypted version of a file to make sure we don't
accidentially change the ciphertext generation.
2017-05-30 17:04:46 +02:00
Jakob Unterwurzacher
efc88346be cli: enable "-raw64" by default
This brings the CLI options back in sync with the default
feature flags.
2017-03-07 20:56:50 +01:00
Jakob Unterwurzacher
f1244b6d06 tests: recreate v1.3 example filesystem
The filesystem was created with a gocryptfs version that ignored
the HKDF flag (hence everything was actually encrypted WITHOUT hkdf).

Fix it by recreating it.
2017-03-07 20:56:50 +01:00
Jakob Unterwurzacher
2362e67a9e cli: add "-hkdf" option
This commit also enables actually passing the HKDF setting to
fusefrontend, this was missing till now.
2017-03-07 20:56:50 +01:00
Jakob Unterwurzacher
b7538fc026 tests: add v1.3 example filesystem
This filesystem has both HKDF and Raw64 enabled.
2017-03-05 23:07:52 +01:00
Jakob Unterwurzacher
966308eeb7 Drop Go 1.4 compatability code everywhere
Yields a nice reduction in code size.
2017-03-05 17:44:14 +01:00
Jakob Unterwurzacher
b2f154a9a9 tests: stop calling t.Fatal from example_test_helpers
Calling t.Fatal immeadiately aborts the test, which means the
filesystem will not get unmounted, which means test.bash will
hang.
2017-03-05 13:39:25 +01:00
Jakob Unterwurzacher
d2c0fae4f6 tests: somewhat support testing without openssl
You will still get lots of test error, but at least the tests
will run.
2017-02-26 19:53:29 +01:00
Jakob Unterwurzacher
3f5c48e058 tests: don't call t.Fatal in checkExampleFS
Calling t.Fatal means that the parent test has no chance
to clean up.
2016-11-26 15:20:54 +01:00
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
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
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
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
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
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
Jakob Unterwurzacher
8a2e1a543a tests: add v0.7-plaintextnames example filesystem
The v0.6-plaintextnames example FS lacks the GCMIV128 feature
flag, is no longer mountable and can no longer be used for testing.

Add a new "-plaintextnames" filesystem created by gocryptfs v0.7.
There have been no format changes to "-plaintextnames" since then.
2016-06-23 20:53:14 +02:00
Jakob Unterwurzacher
930e597f5a tests: expect mount failure for v0.6 and older example filesystems 2016-06-19 20:04:09 +02:00
Jakob Unterwurzacher
4d067e2de1 tests: adapt for read-only operation
The v0.6 and older example filesystem are mounted read-only
because they are deprecated, so skip the read-write tests.
2016-06-16 23:24:32 +02:00
Jakob Unterwurzacher
96750a7d3c tests: exit with correct error code from TestMain
extpass_test and example_filesystems_test did it wrong,
always returning 0.
2016-06-16 21:56:23 +02:00
Jakob Unterwurzacher
c2a5303eeb tests: split example_filesystems into its own package
Running these tests from integration_tests' TestMain() was awkward
because they were run twice with unchanged settings.
integration_tests tests everything with OpenSSL and with native
Go crypto, but this does not take affect for the example filesystems.

To make this work, test_helpers is also split into its own package.
2016-06-07 00:08:56 +02:00