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

Method KillDaemon

pkg/testutil/testutil.go:150–165  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

148}
149
150func (b *Base) KillDaemon() {
151 b.T.Helper()
152 if !b.DaemonIsKillable {
153 b.T.Skip("daemon is not killable (hint: set \"-test.allow-kill-daemon\")")
154 }
155 target := b.systemctlTarget()
156 b.T.Logf("killing %q", target)
157 cmdKill := exec.Command("systemctl",
158 append(b.systemctlArgs(),
159 []string{"kill", target}...)...)
160 if out, err := cmdKill.CombinedOutput(); err != nil {
161 err = fmt.Errorf("cannot kill %q: %q: %w", target, string(out), err)
162 b.T.Fatal(err)
163 }
164 // the daemon should restart automatically
165}
166
167func (b *Base) EnsureDaemonActive() {
168 b.T.Helper()

Callers

nothing calls this directly

Calls 5

systemctlTargetMethod · 0.95
systemctlArgsMethod · 0.95
HelperMethod · 0.65
SkipMethod · 0.65
CommandMethod · 0.65

Tested by

no test coverage detected