Commit e5d377b5 authored by Aaron Jacobs's avatar Aaron Jacobs

ErrorFSTest.ReadFile

parent 1ea2e821
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
package errorfs_test package errorfs_test
import ( import (
"io/ioutil"
"os" "os"
"path" "path"
"reflect" "reflect"
...@@ -70,7 +71,15 @@ func (t *ErrorFSTest) OpenFile() { ...@@ -70,7 +71,15 @@ func (t *ErrorFSTest) OpenFile() {
} }
func (t *ErrorFSTest) ReadFile() { 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() { func (t *ErrorFSTest) OpenDir() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment