fuse: add unit-tests for loopback Utimens()
Tests loopbackFileSystem.Utimens() and loopbackfile.Utimens() at 1-second precision. The exising TestUtimesNano() test only works on Linux because it relies on syscall.UtimesNano(), which is not available on Darwin. The new tests call the Utimens() functions directly, bypassing FUSE, and work on all platforms. Because Darwin does not have syscall.UtimesNano(), getting the Utimens() implementation right is hard. The tests currently fail on Darwin, underlining the need for them ( https://github.com/rfjakob/gocryptfs/issues/229 ): $ go test ./fuse/nodefs [...] --- FAIL: TestLoopbackFileUtimens (0.00s) helpers.go:51: mtime has changed: 1525384186 -> 1073 helpers.go:70: atime has changed: 1525291058 -> 1073 [...] $ go test ./fuse/pathfs --- FAIL: TestLoopbackFileSystemUtimens (0.00s) helpers.go:51: mtime has changed: 1525384379 -> 1073 helpers.go:70: atime has changed: 1525291058 -> 1073 [...]
Showing
fuse/nodefs/files_test.go
0 → 100644
fuse/pathfs/loopback_test.go
0 → 100644
internal/testutil/helpers.go
0 → 100644
Please register or sign in to comment