2019-08-29 20:52:40 +00:00
|
|
|
package daemon
|
2016-07-27 18:17:44 +00:00
|
|
|
|
|
|
|
import (
|
2016-07-28 15:58:06 +00:00
|
|
|
"fmt"
|
2020-03-13 13:37:09 +00:00
|
|
|
"os/exec"
|
2016-07-27 18:17:44 +00:00
|
|
|
"strconv"
|
2019-09-23 11:54:51 +00:00
|
|
|
"testing"
|
2016-08-23 23:50:15 +00:00
|
|
|
|
2016-11-21 22:35:06 +00:00
|
|
|
"golang.org/x/sys/windows"
|
2020-02-07 13:39:24 +00:00
|
|
|
"gotest.tools/v3/assert"
|
2016-07-27 18:17:44 +00:00
|
|
|
)
|
|
|
|
|
2016-12-09 09:17:53 +00:00
|
|
|
// SignalDaemonDump sends a signal to the daemon to write a dump file
|
|
|
|
func SignalDaemonDump(pid int) {
|
2017-08-21 10:58:09 +00:00
|
|
|
ev, _ := windows.UTF16PtrFromString("Global\\docker-daemon-" + strconv.Itoa(pid))
|
|
|
|
h2, err := windows.OpenEvent(0x0002, false, ev)
|
|
|
|
if h2 == 0 || err != nil {
|
2016-07-27 18:17:44 +00:00
|
|
|
return
|
|
|
|
}
|
2017-08-21 10:58:09 +00:00
|
|
|
windows.PulseEvent(h2)
|
2016-07-27 18:17:44 +00:00
|
|
|
}
|
2016-07-28 15:58:06 +00:00
|
|
|
|
|
|
|
func signalDaemonReload(pid int) error {
|
|
|
|
return fmt.Errorf("daemon reload not supported")
|
|
|
|
}
|
2016-08-23 23:50:15 +00:00
|
|
|
|
2020-09-19 16:45:41 +00:00
|
|
|
func cleanupMount(_ testing.TB, _ *Daemon) {}
|
|
|
|
|
2019-10-09 11:17:52 +00:00
|
|
|
func cleanupNetworkNamespace(_ testing.TB, _ *Daemon) {}
|
2019-03-15 03:44:18 +00:00
|
|
|
|
|
|
|
// CgroupNamespace returns the cgroup namespace the daemon is running in
|
2019-09-23 11:54:51 +00:00
|
|
|
func (d *Daemon) CgroupNamespace(t testing.TB) string {
|
2019-03-15 03:44:18 +00:00
|
|
|
assert.Assert(t, false)
|
|
|
|
return "cgroup namespaces are not supported on Windows"
|
|
|
|
}
|
2020-03-13 13:37:09 +00:00
|
|
|
|
|
|
|
func setsid(cmd *exec.Cmd) {
|
|
|
|
}
|