MCPcopy Index your code
hub / github.com/containerd/containerd / testMount

Function testMount

plugins/snapshots/blockfile/blockfile_loopsetup_test.go:78–97  ·  view source on GitHub ↗
(t *testing.T, scratchFile string, opts []string)

Source from the content-addressed store, hash-verified

76}
77
78func testMount(t *testing.T, scratchFile string, opts []string) error {
79 root := t.TempDir()
80
81 m := []mount.Mount{
82 {
83 Type: "ext4",
84 Source: scratchFile,
85 Options: opts,
86 },
87 }
88
89 if err := mount.All(m, root); err != nil {
90 return fmt.Errorf("failed to mount device %s: %w", scratchFile, err)
91 }
92
93 if err := os.Remove(filepath.Join(root, "lost+found")); err != nil {
94 return err
95 }
96 return mount.UnmountAll(root, 0)
97}
98
99func testViewHook(backingFile string, fsType string, defaultOpts []string) error {
100 root, err := os.MkdirTemp("", "blockfile-testViewHook-XXXX")

Callers 1

setupSnapshotterFunction · 0.70

Calls 3

AllFunction · 0.92
UnmountAllFunction · 0.92
RemoveMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…