integration: Enable some tests for Windows (part 2)

Some of the tests that are currently running only on Linux can be made
to run on Windows with a few changes.

Signed-off-by: Claudiu Belu <cbelu@cloudbasesolutions.com>
This commit is contained in:
Claudiu Belu
2021-10-12 11:27:43 +03:00
parent d97b40c300
commit 830b3c26ec
8 changed files with 440 additions and 402 deletions

View File

@@ -19,6 +19,7 @@ package client
import (
"context"
"io"
"runtime"
"sync"
"syscall"
@@ -110,8 +111,12 @@ func (d *daemon) Restart(stopCb func()) error {
return errors.New("daemon is not running")
}
signal := syscall.SIGTERM
if runtime.GOOS == "windows" {
signal = syscall.SIGKILL
}
var err error
if err = d.cmd.Process.Signal(syscall.SIGTERM); err != nil {
if err = d.cmd.Process.Signal(signal); err != nil {
return errors.Wrap(err, "failed to signal daemon")
}