MCPcopy
hub / github.com/containerd/containerd / FakeOS

Struct FakeOS

pkg/os/testing/fake_os.go:40–55  ·  view source on GitHub ↗

FakeOS mocks out certain OS calls to avoid perturbing the filesystem If a member of the form `*Fn` is set, that function will be called in place of the real call.

Source from the content-addressed store, hash-verified

38// If a member of the form `*Fn` is set, that function will be called in place
39// of the real call.
40type FakeOS struct {
41 sync.Mutex
42 MkdirAllFn func(string, os.FileMode) error
43 RemoveAllFn func(string) error
44 StatFn func(string) (os.FileInfo, error)
45 ResolveSymbolicLinkFn func(string) (string, error)
46 FollowSymlinkInScopeFn func(string, string) (string, error)
47 CopyFileFn func(string, string, os.FileMode) error
48 WriteFileFn func(string, []byte, os.FileMode) error
49 MountFn func(source string, target string, fstype string, flags uintptr, data string) error
50 UnmountFn func(target string) error
51 LookupMountFn func(path string) (containerdmount.Info, error)
52 HostnameFn func() (string, error)
53 calls []CalledDetail
54 errors map[string]error
55}
56
57var _ osInterface.OS = &FakeOS{}
58

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected