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