diff --git a/e2e/main_test.go b/e2e/main_test.go index d70558ab..c13e966a 100644 --- a/e2e/main_test.go +++ b/e2e/main_test.go @@ -13,7 +13,6 @@ import ( "os/exec" "strconv" "strings" - "syscall" "testing" "time" @@ -59,7 +58,7 @@ func runCmd(cmd string, args ...string) (*exec.Cmd, io.Writer, io.Reader, error) newargs := append([]string{cmd}, args...) newargs = append([]string{"-i0", "-o0", "-e0"}, newargs...) c := exec.Command("stdbuf", newargs...) - c.SysProcAttr = &syscall.SysProcAttr{Pdeathsig: syscall.SIGTERM} + c.SysProcAttr = sigtermForPdeathsig f, err := pty.Start(c) if err != nil { return nil, nil, nil, err diff --git a/e2e/pdeathsig_linux_test.go b/e2e/pdeathsig_linux_test.go new file mode 100644 index 00000000..0e92ff64 --- /dev/null +++ b/e2e/pdeathsig_linux_test.go @@ -0,0 +1,9 @@ +//go:build linux + +package e2e_test + +import ( + "syscall" +) + +var sigtermForPdeathsig = &syscall.SysProcAttr{Pdeathsig: syscall.SIGTERM} diff --git a/e2e/pdeathsig_other_test.go b/e2e/pdeathsig_other_test.go new file mode 100644 index 00000000..44636e11 --- /dev/null +++ b/e2e/pdeathsig_other_test.go @@ -0,0 +1,9 @@ +//go:build !linux + +package e2e_test + +import ( + "syscall" +) + +var sigtermForPdeathsig *syscall.SysProcAttr