diff options
| author | Jakob Unterwurzacher | 2018-04-07 15:21:05 +0200 | 
|---|---|---|
| committer | Jakob Unterwurzacher | 2018-04-07 15:24:00 +0200 | 
| commit | 22031d7e531985e9e94d694e74fb00da99de72a5 (patch) | |
| tree | a3342b55aecc3076f40a08fd968fdbac3f82f8ad /tests/matrix | |
| parent | 4e5783591f9874e2c7336598c96ebd2c5840bd5b (diff) | |
tests: matrix: check for fd leaks
And fix two in test_helpers.Mount().
Leftover fds can cause an unmount failure like this later:
fusermount: failed to unmount /tmp/gocryptfs-test-parent/873632270/default-plain: Device or resource busy
so try to catch them early.
Diffstat (limited to 'tests/matrix')
| -rw-r--r-- | tests/matrix/matrix_test.go | 8 | 
1 files changed, 8 insertions, 0 deletions
| diff --git a/tests/matrix/matrix_test.go b/tests/matrix/matrix_test.go index 37c7b20..bc964ae 100644 --- a/tests/matrix/matrix_test.go +++ b/tests/matrix/matrix_test.go @@ -72,7 +72,15 @@ func TestMain(m *testing.M) {  		opts = append(opts, fmt.Sprintf("-aessiv=%v", testcase.aessiv))  		opts = append(opts, fmt.Sprintf("-raw64=%v", testcase.raw64))  		test_helpers.MountOrExit(test_helpers.DefaultCipherDir, test_helpers.DefaultPlainDir, opts...) +		before := test_helpers.ListFds()  		r := m.Run() +		after := test_helpers.ListFds() +		if len(before) != len(after) { +			fmt.Printf("fd leak? before, after:\n") +			fmt.Printf("%v\n", before) +			fmt.Printf("%v\n", after) +			os.Exit(1) +		}  		test_helpers.UnmountPanic(test_helpers.DefaultPlainDir)  		if r != 0 {  			os.Exit(r) | 
