github.com/lacework-dev/go-moby@v20.10.12+incompatible/testutil/daemon/daemon_windows.go (about)

     1  package daemon
     2  
     3  import (
     4  	"fmt"
     5  	"os/exec"
     6  	"strconv"
     7  	"testing"
     8  
     9  	"golang.org/x/sys/windows"
    10  	"gotest.tools/v3/assert"
    11  )
    12  
    13  // SignalDaemonDump sends a signal to the daemon to write a dump file
    14  func SignalDaemonDump(pid int) {
    15  	ev, _ := windows.UTF16PtrFromString("Global\\docker-daemon-" + strconv.Itoa(pid))
    16  	h2, err := windows.OpenEvent(0x0002, false, ev)
    17  	if h2 == 0 || err != nil {
    18  		return
    19  	}
    20  	windows.PulseEvent(h2)
    21  }
    22  
    23  func signalDaemonReload(pid int) error {
    24  	return fmt.Errorf("daemon reload not supported")
    25  }
    26  
    27  func cleanupMount(_ testing.TB, _ *Daemon) {}
    28  
    29  func cleanupNetworkNamespace(_ testing.TB, _ *Daemon) {}
    30  
    31  // CgroupNamespace returns the cgroup namespace the daemon is running in
    32  func (d *Daemon) CgroupNamespace(t testing.TB) string {
    33  	assert.Assert(t, false)
    34  	return "cgroup namespaces are not supported on Windows"
    35  }
    36  
    37  func setsid(cmd *exec.Cmd) {
    38  }