diff options
author | Jakob Unterwurzacher | 2023-06-05 12:42:33 +0200 |
---|---|---|
committer | Jakob Unterwurzacher | 2024-12-04 19:53:15 +0100 |
commit | f089268daa3745f2c7e8d17b1876fc58f6b49f46 (patch) | |
tree | beabd89e691191a091c7e1b5264310fd0f9a5b19 /tests | |
parent | 8f76d1ea0a63f546ad09fa70be1ed7b6a7d29fe6 (diff) |
tests/cluster: add TestConcurrentCreate
This exercises the byte-range locks we just added.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/cluster/cluster_test.go | 3 | ||||
-rw-r--r-- | tests/test_helpers/helpers.go | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/tests/cluster/cluster_test.go b/tests/cluster/cluster_test.go index f9d0903..99a017f 100644 --- a/tests/cluster/cluster_test.go +++ b/tests/cluster/cluster_test.go @@ -15,6 +15,7 @@ import ( "syscall" "testing" + "github.com/rfjakob/gocryptfs/v2/internal/contentenc" "github.com/rfjakob/gocryptfs/v2/tests/test_helpers" ) @@ -39,7 +40,7 @@ func TestClusterConcurrentRW(t *testing.T) { "Choose a backing directory by setting TMPDIR.") } - const blocksize = 4096 + const blocksize = contentenc.DefaultBS const fileSize = 25 * blocksize // 100 kiB cDir := test_helpers.InitFS(t) diff --git a/tests/test_helpers/helpers.go b/tests/test_helpers/helpers.go index 0d21548..b3594e6 100644 --- a/tests/test_helpers/helpers.go +++ b/tests/test_helpers/helpers.go @@ -10,6 +10,7 @@ import ( "os" "os/exec" "path/filepath" + "strings" "syscall" "testing" @@ -147,6 +148,7 @@ func InitFS(t *testing.T, extraArgs ...string) string { prefix := "x." if t != nil { prefix = t.Name() + "." + prefix = strings.ReplaceAll(prefix, "/", "_") } dir, err := ioutil.TempDir(TmpDir, prefix) if err != nil { |