MCPcopy Create free account
hub / github.com/containerd/nerdctl / prepareCustomRootfs

Function prepareCustomRootfs

cmd/nerdctl/container/container_run_linux_test.go:70–82  ·  view source on GitHub ↗
(base *testutil.Base, imageName string)

Source from the content-addressed store, hash-verified

68}
69
70func prepareCustomRootfs(base *testutil.Base, imageName string) string {
71 base.Cmd("pull", "--quiet", imageName).AssertOK()
72 tmpDir, err := os.MkdirTemp(base.T.TempDir(), "test-save")
73 assert.NilError(base.T, err)
74 defer os.RemoveAll(tmpDir)
75 archiveTarPath := filepath.Join(tmpDir, "a.tar")
76 base.Cmd("save", "-o", archiveTarPath, imageName).AssertOK()
77 rootfs, err := os.MkdirTemp(base.T.TempDir(), "rootfs")
78 assert.NilError(base.T, err)
79 err = helpers.ExtractDockerArchive(archiveTarPath, rootfs)
80 assert.NilError(base.T, err)
81 return rootfs
82}
83
84func TestRunShmSize(t *testing.T) {
85 t.Parallel()

Callers 1

TestRunCustomRootfsFunction · 0.85

Calls 4

ExtractDockerArchiveFunction · 0.92
AssertOKMethod · 0.80
TempDirMethod · 0.65
CmdMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…