Merge pull request #6180 from claudiubelu/integration/windows-ip-leak
integration: Adds Windows equivalent for TestSandboxRemoveWithoutIPLeakage
This commit is contained in:
@@ -386,8 +386,12 @@ func KillProcess(name string) error {
|
||||
}
|
||||
|
||||
// KillPid kills the process by pid. kill is used.
|
||||
func KillPid(pid int) error { //nolint:unused
|
||||
output, err := exec.Command("kill", strconv.Itoa(pid)).CombinedOutput()
|
||||
func KillPid(pid int) error {
|
||||
command := "kill"
|
||||
if goruntime.GOOS == "windows" {
|
||||
command = "tskill"
|
||||
}
|
||||
output, err := exec.Command(command, strconv.Itoa(pid)).CombinedOutput()
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to kill %d - error: %v, output: %q", pid, err, output)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user