diff options
| author | Jakob Unterwurzacher | 2025-08-03 21:05:32 +0200 | 
|---|---|---|
| committer | Jakob Unterwurzacher | 2025-08-03 21:25:24 +0200 | 
| commit | ca83d1dcdc305418b0a0baa297a340cf702a60fc (patch) | |
| tree | 949ed9f5a25ba171b3c77aebc2b456771401cfa8 /tests | |
| parent | 08d26a70dd6bc268c18e9f8511aa6286ecb29403 (diff) | |
tests: matrix: enable ctlsock
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/matrix/main_test.go | 9 | ||||
| -rw-r--r-- | tests/matrix/matrix_test.go | 1 | 
2 files changed, 9 insertions, 1 deletions
| diff --git a/tests/matrix/main_test.go b/tests/matrix/main_test.go index 76df452..24f477e 100644 --- a/tests/matrix/main_test.go +++ b/tests/matrix/main_test.go @@ -22,6 +22,8 @@ import (  // a global variable  var testcase testcaseMatrix +var ctlsockPath string +  type testcaseMatrix struct {  	plaintextnames bool  	openssl        string @@ -80,8 +82,9 @@ func TestMain(m *testing.M) {  		} else if testcase.isSet("-deterministic-names") {  			createDirIV = false  		} +		ctlsockPath = test_helpers.TmpDir + "/ctlsock"  		test_helpers.ResetTmpDir(createDirIV) -		opts := []string{"-zerokey"} +		opts := []string{"-zerokey", "-ctlsock", ctlsockPath}  		//opts = append(opts, "-fusedebug")  		opts = append(opts, fmt.Sprintf("-openssl=%v", testcase.openssl))  		opts = append(opts, fmt.Sprintf("-plaintextnames=%v", testcase.plaintextnames)) @@ -109,6 +112,10 @@ func TestMain(m *testing.M) {  			fmt.Printf("TestMain: matrix[%d] = %#v failed\n", i, testcase)  			os.Exit(r)  		} +		// The ctlsock file is deleted asynchronously after unmount. +		// Ensure it is delete here so it does not race (and trip up) ResetTmpDir() of the next +		// loop iteration. +		os.Remove(ctlsockPath)  	}  	os.Exit(0)  } diff --git a/tests/matrix/matrix_test.go b/tests/matrix/matrix_test.go index d32d3d8..8387a5d 100644 --- a/tests/matrix/matrix_test.go +++ b/tests/matrix/matrix_test.go @@ -15,6 +15,7 @@ import (  	"golang.org/x/sys/unix" +	"github.com/rfjakob/gocryptfs/v2/ctlsock"  	"github.com/rfjakob/gocryptfs/v2/tests/test_helpers"  ) | 
