MCPcopy Create free account
hub / github.com/containerd/nerdctl / DumpDaemonLogs

Method DumpDaemonLogs

pkg/testutil/testutil.go:195–207  ·  view source on GitHub ↗
(minutes int)

Source from the content-addressed store, hash-verified

193}
194
195func (b *Base) DumpDaemonLogs(minutes int) {
196 b.T.Helper()
197 target := b.systemctlTarget()
198 cmd := exec.Command("journalctl",
199 append(b.systemctlArgs(), "-u", target, "--no-pager", "-S", fmt.Sprintf("%d min ago", minutes))...)
200 b.T.Logf("===== %v =====", cmd.Args)
201 out, err := cmd.CombinedOutput()
202 if err != nil {
203 b.T.Fatal(err)
204 }
205 b.T.Log(string(out))
206 b.T.Log("==========")
207}
208
209func (b *Base) InspectContainer(name string) dockercompat.Container {
210 cmdResult := b.Cmd("container", "inspect", name).Run()

Callers

nothing calls this directly

Calls 5

systemctlTargetMethod · 0.95
systemctlArgsMethod · 0.95
HelperMethod · 0.65
CommandMethod · 0.65
LogMethod · 0.65

Tested by

no test coverage detected