From ca83d1dcdc305418b0a0baa297a340cf702a60fc Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Sun, 3 Aug 2025 21:05:32 +0200 Subject: tests: matrix: enable ctlsock --- tests/matrix/main_test.go | 9 ++++++++- tests/matrix/matrix_test.go | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) 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" ) -- cgit v1.2.3