Unmounting leftover mounts is a convenience function for developers,
but it would need to be expanded to work on MacOS and FreeBSD, which
adds more complexity.
Let's keep test.sh at the bare minimum that is needed for its purpose:
running the tests.
We had the situation that "make test" runs the test suite but does not
show useful error messages (see
https://github.com/vgough/encfs/issues/358 for an example).
"make check" did the right thing by using the "--output-on-failure"
feature, but depended on "make test" being available as well. This
means users will continue to run "make test".
This commits drops the cmake test logic and adds a dumb "make test"
target that simply runs test.sh.
gcc is default compiler on most distributions, we should
also test with it.
build.sh exists and should be tested as well, so why not use
it in Travis.
test.sh outputs much more details than "make check", so
run it as well.
Additionally, make build.sh and test.sh work when called from
other directories.
On July 18, Travis upgraded their default build VM
to Ubuntu Trusty. Trusty has cmake 3.5.1, which allows us to
drop our bundled version.
We explicitely set "dist: trusty" to prevent our build jobs
from being routed to an older build VM.
When a file is opened twice concurrently, we can end up with
two separate FileNodes for a single path.
This seems to be the root cause for the crashes reported under
https://github.com/vgough/encfs/issues/214 , as commit
af64702dd0
"Simplify FileNode Cache. Remove the need for PlaceHolder."
removed the awareness for different FileNodes.
The crashes have been fixed by
e2f0f8e3c6
"fuseFhMap: translate FUSE file handles to FileNode pointers"
at the cost of introducing a memory leak. One of the two FileNodes
would stay in fuseFhMap forever.
This commit makes eraseNode again aware of different FileNodes for
a single path, makes sure the right FileNode is erased, and fixes
the memory leak.
Previously, we used raw pointers to the FileNode as FUSE file handles.
With this change, we instead pass an arbitrary value (a uint64 counter)
to the kernel as FUSE file handle, and use the "fuseFhMap" look-up table
to convert back to the FileNode pointer.
This gets rid of a lot of scary void pointer casts. The performance
cost is not measurable.
The do_op closure is complicated enough. Get the canary check out
of the way to not make it even more complicated.
Also, use an explicitely atomic type for the canary.
We run through everything in normal.t.pl two times, once
in "standard" mode and once in "paranoia" mode. Print some
context. Also, bail out if file creation fails.
Output now looks like this:
$ ./test.sh
tests/normal.t.pl ...
runTests: mode=standard
tests/normal.t.pl ... 54/116
runTests: mode=paranoia
tests/normal.t.pl ... ok
tests/reverse.t.pl .. ok
All tests successful.
Files=2, Tests=141, 21 wallclock secs ( 0.04 usr 0.00 sys + 20.03 cusr 0.36 csys = 20.43 CPU)
Result: PASS