Commit f89cd0c4 authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Remove incorrect TestInodeNotifyRemoval() test.

parent 1e311fd7
......@@ -183,8 +183,15 @@ type DefaultRawFileSystem struct{}
// Talk back to FUSE.
//
// TODO - implement EntryNotify. Currently, EntryNotify causes a
// kernel error.
// InodeNotify invalidates the information associated with the inode
// (ie. data cache, attributes, etc.)
//
// EntryNotify should be used if the existence status of an entry changes,
// (ie. to notify of creation or deletion of the file).
//
// Somewhat confusingly, InodeNotify for a file that stopped to exist
// will give the correct result for Lstat (ENOENT), but the kernel
// will still issue file Open() on the inode.
type RawFsInit struct {
InodeNotify func(*NotifyInvalInodeOut) Status
EntryNotify func(parent uint64, name string) Status
......
......@@ -27,6 +27,10 @@ func (me *NotifyFs) GetAttr(name string) (*os.FileInfo, Status) {
return nil, ENOENT
}
func (me *NotifyFs) Open(name string, f uint32) (File, Status) {
return NewReadOnlyFile([]byte{42}), OK
}
type NotifyTest struct {
fs *NotifyFs
connector *FileSystemConnector
......@@ -94,35 +98,6 @@ func TestInodeNotify(t *testing.T) {
}
}
func TestInodeNotifyRemoval(t *testing.T) {
test := NewNotifyTest()
defer test.Clean()
fs := test.fs
dir := test.dir
fs.exist = true
fi, err := os.Lstat(dir + "/dir/file")
CheckSuccess(err)
if !fi.IsRegular() {
t.Error("IsRegular", fi)
}
fs.exist = false
fi, err = os.Lstat(dir + "/dir/file")
CheckSuccess(err)
code := test.connector.FileNotify("dir/file", -1, 0)
if !code.Ok() {
t.Error(code)
}
fi, err = os.Lstat(dir + "/dir/file")
if fi != nil {
t.Error("should have been removed", fi)
}
}
func TestEntryNotify(t *testing.T) {
test := NewNotifyTest()
defer test.Clean()
......
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