MCPcopy
hub / github.com/google/gvisor / newTestFD

Function newTestFD

pkg/sentry/kernel/fd_table_test.go:47–53  ·  view source on GitHub ↗
(ctx context.Context, vfsObj *vfs.VirtualFilesystem)

Source from the content-addressed store, hash-verified

45func (fd *testFD) Release(context.Context) {}
46
47func newTestFD(ctx context.Context, vfsObj *vfs.VirtualFilesystem) *vfs.FileDescription {
48 vd := vfsObj.NewAnonVirtualDentry("testFD")
49 defer vd.DecRef(ctx)
50 var fd testFD
51 fd.vfsfd.Init(&fd, 0 /* flags */, auth.CredentialsFromContext(ctx), vd.Mount(), vd.Dentry(), &vfs.FileDescriptionOptions{})
52 return &fd.vfsfd
53}
54
55func runTest(t testing.TB, fn func(ctx context.Context, fdTable *FDTable, fd *vfs.FileDescription, limitSet *limits.LimitSet)) {
56 t.Helper() // Don't show in stacks.

Callers 1

runTestFunction · 0.70

Calls 6

CredentialsFromContextFunction · 0.92
NewAnonVirtualDentryMethod · 0.80
DecRefMethod · 0.65
InitMethod · 0.65
MountMethod · 0.65
DentryMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…