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

Function TestFUSEHelper

core/mount/mount_linux_test.go:114–142  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

112}
113
114func TestFUSEHelper(t *testing.T) {
115 testutil.RequiresRoot(t)
116 const fuseoverlayfsBinary = "fuse-overlayfs"
117 _, err := exec.LookPath(fuseoverlayfsBinary)
118 if err != nil {
119 t.Skip("fuse-overlayfs not installed")
120 }
121 td := t.TempDir()
122
123 for _, dir := range []string{"lower1", "lower2", "upper", "work", "merged"} {
124 if err := os.Mkdir(filepath.Join(td, dir), 0755); err != nil {
125 t.Fatal(err)
126 }
127 }
128
129 opts := fmt.Sprintf("lowerdir=%s:%s,upperdir=%s,workdir=%s", filepath.Join(td, "lower2"), filepath.Join(td, "lower1"), filepath.Join(td, "upper"), filepath.Join(td, "work"))
130 m := Mount{
131 Type: "fuse3." + fuseoverlayfsBinary,
132 Source: "overlay",
133 Options: []string{opts},
134 }
135 dest := filepath.Join(td, "merged")
136 if err := m.Mount(dest); err != nil {
137 t.Fatal(err)
138 }
139 if err := UnmountAll(dest, 0); err != nil {
140 t.Fatal(err)
141 }
142}
143
144func TestMountAt(t *testing.T) {
145 testutil.RequiresRoot(t)

Callers

nothing calls this directly

Calls 3

MountMethod · 0.95
FatalMethod · 0.80
UnmountAllFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…