integration: Adds Windows equivalent for TestSandboxRemoveWithoutIPLeakage
Adds an equivalent TestSandboxRemoveWithoutIPLeakage for Windows, in which we assert that the IPs are not leaked when a Pod's HNS namespace dissapears and the Pod is deleted afterwards. Signed-off-by: Claudiu Belu <cbelu@cloudbasesolutions.com>
This commit is contained in:
@@ -377,8 +377,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 errors.Errorf("failed to kill %d - error: %v, output: %q", pid, err, output)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user