summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fs/inode_overlay_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/sentry/fs/inode_overlay_test.go')
-rw-r--r--pkg/sentry/fs/inode_overlay_test.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/pkg/sentry/fs/inode_overlay_test.go b/pkg/sentry/fs/inode_overlay_test.go
index 3ee4c9667..23e5635a4 100644
--- a/pkg/sentry/fs/inode_overlay_test.go
+++ b/pkg/sentry/fs/inode_overlay_test.go
@@ -372,10 +372,14 @@ func TestCacheFlush(t *testing.T) {
type dir struct {
fs.InodeOperations
- // list of negative child names.
+ // List of negative child names.
negative []string
+
+ // Whether DeprecatedReaddir has been called on this dir.
+ ReaddirCalled bool
}
+// Getxattr implements InodeOperations.Getxattr.
func (d *dir) Getxattr(inode *fs.Inode, name string) ([]byte, error) {
for _, n := range d.negative {
if name == fs.XattrOverlayWhiteout(n) {
@@ -385,6 +389,12 @@ func (d *dir) Getxattr(inode *fs.Inode, name string) ([]byte, error) {
return nil, syserror.ENOATTR
}
+// DeprecatedReaddir implements InodeOperations.DeprecatedReaddir.
+func (d *dir) DeprecatedReaddir(ctx context.Context, dirctx *fs.DirCtx, offset int) (int, error) {
+ d.ReaddirCalled = true
+ return d.InodeOperations.DeprecatedReaddir(ctx, dirctx, offset)
+}
+
type dirContent struct {
name string
dir bool