aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJakob Unterwurzacher2026-09-24 20:44:52 +0200
committerrfjakob2026-10-01 20:32:54 +0200
commit22c187b49b033982950248a66ec4134946d62900 (patch)
tree0451057a70c2621c802606958c7804831b4106c1 /tests
parentfc31c8ffa4ccfff4cede7d5c8345d740c5552c5a (diff)
tests: add TestUnlinkedO_SYNC
Relates-to: #1023 https://github.com/rfjakob/gocryptfs/issues/1023
Diffstat (limited to 'tests')
-rw-r--r--tests/matrix/matrix_test.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/matrix/matrix_test.go b/tests/matrix/matrix_test.go
index a2ec549..2f097fb 100644
--- a/tests/matrix/matrix_test.go
+++ b/tests/matrix/matrix_test.go
@@ -993,3 +993,18 @@ func TestRenameExchangeOnGocryptfs(t *testing.T) {
t.Errorf("file2 content wrong after exchange. Expected: %s, Got: %s", content1, newContent2)
}
}
+
+func TestUnlinkedO_SYNC(t *testing.T) {
+ path := test_helpers.DefaultPlainDir + "/" + t.Name()
+ fd, err := syscall.Open(path, syscall.O_CREAT|syscall.O_RDWR|syscall.O_SYNC, 0600)
+ if err != nil {
+ t.Fatal(err)
+ }
+ defer syscall.Close(fd)
+ if err = os.Remove(path); err != nil {
+ t.Fatal(err)
+ }
+ if _, err = syscall.Write(fd, make([]byte, 10)); err != nil {
+ t.Error(err)
+ }
+}