aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Unterwurzacher2026-09-24 20:44:52 +0200
committerJakob Unterwurzacher2026-09-24 20:45:57 +0200
commit4ee088b1a87625bbc7595bba50b2ab05f0ccc7cc (patch)
treecd4f4e51843f2510ec19753021f6fe8107f333a3
parent842af4463989ee6808d397433e9aba8517e49c89 (diff)
tests: add TestUnlinkedO_SYNCunlinked_fsync
Relates-to: #1023 https://github.com/rfjakob/gocryptfs/issues/1023
-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)
+ }
+}