()
| 148 | } |
| 149 | |
| 150 | func (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 | |
| 167 | func (b *Base) EnsureDaemonActive() { |
| 168 | b.T.Helper() |
nothing calls this directly
no test coverage detected