MCPcopy
hub / github.com/containerd/containerd / createTempFile

Function createTempFile

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

Source from the content-addressed store, hash-verified

33var randomData = []byte("randomdata")
34
35func createTempFile(t *testing.T) string {
36 t.Helper()
37
38 f, err := os.Create(filepath.Join(t.TempDir(), "losetup"))
39 require.NoError(t, err)
40 t.Cleanup(func() {
41 f.Close()
42 })
43
44 err = f.Truncate(512)
45 require.NoError(t, err)
46
47 return f.Name()
48}
49
50func TestNonExistingLoop(t *testing.T) {
51 testutil.RequiresRoot(t)

Callers 5

TestRoLoopFunction · 0.70
TestRwLoopFunction · 0.70
TestAutoclearTrueLoopFunction · 0.70
TestAutoclearFalseLoopFunction · 0.70

Calls 5

CreateMethod · 0.65
CleanupMethod · 0.65
CloseMethod · 0.65
TruncateMethod · 0.65
NameMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…