runContainerOk is a wrapper for runContainer, simplifying its use for cases when the run is expected to succeed and return exit code of 0.
(t testing.TB, config *configs.Config, args ...string)
| 211 | // runContainerOk is a wrapper for runContainer, simplifying its use for cases |
| 212 | // when the run is expected to succeed and return exit code of 0. |
| 213 | func runContainerOk(t testing.TB, config *configs.Config, args ...string) *stdBuffers { |
| 214 | buffers, exitCode, err := runContainer(t, config, args...) |
| 215 | |
| 216 | t.Helper() |
| 217 | if err != nil { |
| 218 | t.Fatalf("%s: %s", buffers, err) |
| 219 | } |
| 220 | if exitCode != 0 { |
| 221 | t.Fatalf("exit code not 0. code %d stderr %q", exitCode, buffers.Stderr) |
| 222 | } |
| 223 | |
| 224 | return buffers |
| 225 | } |
| 226 | |
| 227 | func destroyContainer(container *libcontainer.Container) { |
| 228 | _ = container.Destroy() |
no test coverage detected
searching dependent graphs…