(f *testing.F)
| 28 | ) |
| 29 | |
| 30 | func 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 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…