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.
| 38 | // If a member of the form `*Fn` is set, that function will be called in place |
| 39 | // of the real call. |
| 40 | type 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 | |
| 57 | var _ osInterface.OS = &FakeOS{} |
| 58 |
nothing calls this directly
no outgoing calls
no test coverage detected