MCPcopy
hub / github.com/containerd/containerd / FuzzExchange

Function FuzzExchange

contrib/fuzz/exchange_fuzz_test.go:30–57  ·  view source on GitHub ↗
(f *testing.F)

Source from the content-addressed store, hash-verified

28)
29
30func FuzzExchange(f *testing.F) {
31 f.Fuzz(func(t *testing.T, data []byte) {
32 f := fuzz.NewConsumer(data)
33 namespace, err := f.GetString()
34 if err != nil {
35 return
36 }
37 event := &eventstypes.ContainerCreate{}
38 err = f.GenerateStruct(event)
39 if err != nil {
40 return
41 }
42 input, err := f.GetString()
43 if err != nil {
44 return
45 }
46
47 env := &events.Envelope{}
48 err = f.GenerateStruct(env)
49 if err != nil {
50 return
51 }
52 ctx := namespaces.WithNamespace(context.Background(), namespace)
53 exch := exchange.NewExchange()
54 exch.Publish(ctx, input, event)
55 exch.Forward(ctx, env)
56 })
57}

Callers

nothing calls this directly

Calls 4

PublishMethod · 0.95
ForwardMethod · 0.95
WithNamespaceFunction · 0.92
NewExchangeFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…