e2e: make e2e tests runnable on !linux (#651)
This commit is contained in:
parent
89ab72bee0
commit
85d1e1a5fc
3 changed files with 19 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
9
e2e/pdeathsig_linux_test.go
Normal file
9
e2e/pdeathsig_linux_test.go
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
//go:build linux
|
||||
|
||||
package e2e_test
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
)
|
||||
|
||||
var sigtermForPdeathsig = &syscall.SysProcAttr{Pdeathsig: syscall.SIGTERM}
|
||||
9
e2e/pdeathsig_other_test.go
Normal file
9
e2e/pdeathsig_other_test.go
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
//go:build !linux
|
||||
|
||||
package e2e_test
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
)
|
||||
|
||||
var sigtermForPdeathsig *syscall.SysProcAttr
|
||||
Loading…
Add table
Add a link
Reference in a new issue