ErrorFSTest.ReadFile

geesefs-0-30-9
Aaron Jacobs 2015-08-04 08:59:34 +10:00
parent 1ea2e82165
commit e5d377b531
1 changed files with 10 additions and 1 deletions

View File

@ -15,6 +15,7 @@
package errorfs_test
import (
"io/ioutil"
"os"
"path"
"reflect"
@ -70,7 +71,15 @@ func (t *ErrorFSTest) OpenFile() {
}
func (t *ErrorFSTest) ReadFile() {
AssertTrue(false, "TODO")
t.fs.SetError(reflect.TypeOf(&fuseops.ReadFileOp{}), syscall.EOWNERDEAD)
// Open
f, err := os.Open(path.Join(t.Dir, "foo"))
AssertEq(nil, err)
// Read
_, err = ioutil.ReadAll(f)
ExpectThat(err, Error(MatchesRegexp("read.*: .*owner died")))
}
func (t *ErrorFSTest) OpenDir() {