Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 ( rfjakob/gocryptfs#229 ): $ go test ./fuse/nodefs [...] --- FAIL: TestLoopbackFileUtimens (0.00s) files_test.go:51: mtime has changed: 1525378914 -> 1073 files_test.go:70: atime has changed: 1525291058 -> 1073 [...] $ go test ./fuse/pathfs --- FAIL: TestLoopbackFileSystemUtimens (0.00s) loopback_test.go:55: mtime has changed: 1525378929 -> 1073 loopback_test.go:74: atime has changed: 1525291058 -> 1073 [...]
- Loading branch information