FlushFSTest.FsyncError

geesefs-0-30-9
Aaron Jacobs 2015-03-20 12:04:25 +11:00
parent 2f3b25c19a
commit 0451a1bafe
1 changed files with 18 additions and 1 deletions

View File

@ -408,5 +408,22 @@ func (t *FlushFSTest) FsyncReports() {
}
func (t *FlushFSTest) FsyncError() {
AssertTrue(false, "TODO")
// Open the file.
f, err := os.OpenFile(path.Join(t.Dir, "foo"), os.O_RDWR, 0)
AssertEq(nil, err)
defer func() {
if f != nil {
ExpectEq(nil, f.Close())
}
}()
// Configure an fsync error.
t.setFsyncError(fuse.ENOENT)
// Fsync.
err = f.Sync()
AssertNe(nil, err)
ExpectThat(err, Error(HasSubstr("TODO")))
}