MCPcopy
hub / github.com/containerd/containerd / TestRwLoop

Function TestRwLoop

core/mount/losetup_linux_test.go:76–90  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

74}
75
76func TestRwLoop(t *testing.T) {
77 testutil.RequiresRoot(t)
78
79 backingFile := createTempFile(t)
80
81 file, err := SetupLoop(backingFile, LoopParams{Autoclear: true})
82 require.NoError(t, err)
83 t.Cleanup(func() {
84 file.Close()
85 })
86
87 if _, err := file.Write(randomData); err != nil {
88 t.Fatal(err)
89 }
90}
91
92func TestAttachDetachLoopDevice(t *testing.T) {
93 testutil.RequiresRoot(t)

Callers

nothing calls this directly

Calls 6

SetupLoopFunction · 0.85
FatalMethod · 0.80
createTempFileFunction · 0.70
CleanupMethod · 0.65
CloseMethod · 0.65
WriteMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…