MCPcopy
hub / github.com/containerd/containerd / fuzzCRI

Function fuzzCRI

contrib/fuzz/cri_server_fuzz_test.go:132–173  ·  view source on GitHub ↗
(t *testing.T, f *fuzz.ConsumeFuzzer, c fuzzCRIService)

Source from the content-addressed store, hash-verified

130}
131
132func fuzzCRI(t *testing.T, f *fuzz.ConsumeFuzzer, c fuzzCRIService) int {
133 ops := []func(c fuzzCRIService, f *fuzz.ConsumeFuzzer) error{
134 createContainerFuzz,
135 removeContainerFuzz,
136 listContainersFuzz,
137 startContainerFuzz,
138 containerStatsFuzz,
139 listContainerStatsFuzz,
140 containerStatusFuzz,
141 stopContainerFuzz,
142 updateContainerResourcesFuzz,
143 listImagesFuzz,
144 removeImagesFuzz,
145 imageStatusFuzz,
146 imageFsInfoFuzz,
147 listPodSandboxFuzz,
148 portForwardFuzz,
149 removePodSandboxFuzz,
150 runPodSandboxFuzz,
151 podSandboxStatusFuzz,
152 stopPodSandboxFuzz,
153 statusFuzz,
154 updateRuntimeConfigFuzz,
155 }
156
157 calls, err := f.GetInt()
158 if err != nil {
159 return 0
160 }
161
162 executionOrder = make([]string, 0)
163 defer printExecutions(t)
164
165 for i := 0; i < calls%40; i++ {
166 op, err := f.GetInt()
167 if err != nil {
168 return 0
169 }
170 ops[op%len(ops)](c, f)
171 }
172 return 1
173}
174
175func logExecution(apiName, request string) {
176 var logString strings.Builder

Callers 1

FuzzCRIServerFunction · 0.85

Calls 1

printExecutionsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…