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