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

Function createMountTestcases

runsc/boot/loader_test.go:310–466  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

308}
309
310func createMountTestcases() []*CreateMountTestcase {
311 testCases := []*CreateMountTestcase{
312 {
313 // Only proc.
314 name: "only proc mount",
315 spec: specs.Spec{
316 Root: &specs.Root{
317 Path: os.TempDir(),
318 Readonly: true,
319 },
320 Mounts: []specs.Mount{
321 {
322 Destination: "/proc",
323 Type: "tmpfs",
324 },
325 },
326 },
327 // /proc, /dev, and /sys should always be mounted.
328 expectedPaths: []string{"/proc", "/dev", "/sys"},
329 },
330 {
331 // Mount at a deep path, with many components that do
332 // not exist in the root.
333 name: "deep mount path",
334 spec: specs.Spec{
335 Root: &specs.Root{
336 Path: os.TempDir(),
337 Readonly: true,
338 },
339 Mounts: []specs.Mount{
340 {
341 Destination: "/some/very/very/deep/path",
342 Type: "tmpfs",
343 },
344 {
345 Destination: "/proc",
346 Type: "tmpfs",
347 },
348 },
349 },
350 // /some/deep/path should be mounted, along with /proc, /dev, and /sys.
351 expectedPaths: []string{"/some/very/very/deep/path", "/proc", "/dev", "/sys"},
352 },
353 {
354 // Mounts are nested inside each other.
355 name: "nested mounts",
356 spec: specs.Spec{
357 Root: &specs.Root{
358 Path: os.TempDir(),
359 Readonly: true,
360 },
361 Mounts: []specs.Mount{
362 {
363 Destination: "/proc",
364 Type: "tmpfs",
365 },
366 {
367 Destination: "/foo",

Callers 1

TestCreateMountNamespaceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…