MCPcopy
hub / github.com/containerd/containerd / testEnv

Function testEnv

contrib/fuzz/metadata_fuzz_test.go:38–51  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

36)
37
38func testEnv(t *testing.T) (context.Context, *bolt.DB, func(), error) {
39 dirname := t.TempDir()
40 db, err := bolt.Open(filepath.Join(dirname, "meta.db"), 0644, nil)
41 if err != nil {
42 return nil, nil, nil, err
43 }
44
45 ctx, cancel := context.WithCancel(context.Background())
46 ctx = namespaces.WithNamespace(ctx, "testing")
47 return ctx, db, func() {
48 db.Close()
49 cancel()
50 }, nil
51}
52
53func FuzzImageStore(f *testing.F) {
54 f.Fuzz(func(t *testing.T, data []byte) {

Callers 3

FuzzImageStoreFunction · 0.70
FuzzLeaseManagerFunction · 0.70
FuzzContainerStoreFunction · 0.70

Calls 3

WithNamespaceFunction · 0.92
CloseMethod · 0.65
OpenMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…