libct/int/checkpoint_test: use kill(0) for pid check

os.FindProcess never returns an error on Unix/Linux.
Use kill(0) to actually check if the process exists.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
Kir Kolyshkin
2021-05-05 11:45:29 -07:00
parent 7eb1405b60
commit 0fabed76c1
+2 -1
View File
@@ -11,6 +11,7 @@ import (
"testing"
"github.com/opencontainers/runc/libcontainer"
"golang.org/x/sys/unix"
)
func showFile(t *testing.T, fname string) error {
@@ -189,7 +190,7 @@ func testCheckpoint(t *testing.T, userns bool) {
pid, err = restoreProcessConfig.Pid()
ok(t, err)
_, err = os.FindProcess(pid)
err = unix.Kill(pid, 0)
ok(t, err)
_, err = restoreStdinW.WriteString("Hello!")