aboutsummaryrefslogtreecommitdiff
path: root/tests/cluster/cluster_test.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2023-06-05 12:46:22 +0200
committerJakob Unterwurzacher2023-06-06 16:24:06 +0200
commitf92a575f431132c429b9a35edc4ece9f2ff8a177 (patch)
tree6476f4f3074a4e8efc6324b8007705991ec06d49 /tests/cluster/cluster_test.go
parent344917ca1be87421f4120187820adb2a41fb130b (diff)
tests/cluster: move PoC tests to poc_test.go
Diffstat (limited to 'tests/cluster/cluster_test.go')
-rw-r--r--tests/cluster/cluster_test.go36
1 files changed, 0 insertions, 36 deletions
diff --git a/tests/cluster/cluster_test.go b/tests/cluster/cluster_test.go
index 23e7c50..9edb2f9 100644
--- a/tests/cluster/cluster_test.go
+++ b/tests/cluster/cluster_test.go
@@ -14,8 +14,6 @@ import (
"syscall"
"testing"
- "golang.org/x/sys/unix"
-
"github.com/rfjakob/gocryptfs/v2/internal/contentenc"
"github.com/rfjakob/gocryptfs/v2/tests/test_helpers"
)
@@ -185,37 +183,3 @@ func TestConcurrentCreate(t *testing.T) {
go workerThread(mnt2 + "/foo")
wg.Wait()
}
-
-// Check that byte-range locks work on an empty file
-func TestFcntlFlock(t *testing.T) {
- path := test_helpers.TmpDir + "/" + t.Name()
-
- fd1, err := syscall.Open(path, syscall.O_CREAT|syscall.O_WRONLY|syscall.O_EXCL, 0600)
- if err != nil {
- t.Fatal(err)
- }
- defer syscall.Close(fd1)
-
- // F_OFD_SETLK locks on the same fd always succeed, so we have to
- // open a 2nd time.
- fd2, err := syscall.Open(path, syscall.O_RDWR, 0)
- if err != nil {
- t.Fatal(err)
- }
- defer syscall.Close(fd2)
-
- lk := unix.Flock_t{
- Type: unix.F_WRLCK,
- Whence: unix.SEEK_SET,
- Start: 0,
- Len: 0,
- }
- err = unix.FcntlFlock(uintptr(fd1), unix.F_OFD_SETLK, &lk)
- if err != nil {
- t.Fatal(err)
- }
- err = unix.FcntlFlock(uintptr(fd2), unix.F_OFD_SETLK, &lk)
- if err == nil {
- t.Fatal("double-lock succeeded but should have failed")
- }
-}