2014-04-25 21:26:22 +08:00
|
|
|
// +build linux freebsd
|
|
|
|
|
2014-12-30 21:09:05 +08:00
|
|
|
package process
|
2014-04-25 21:26:22 +08:00
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
"testing"
|
2017-06-03 04:51:00 +08:00
|
|
|
|
|
|
|
"golang.org/x/sys/unix"
|
2014-04-25 21:26:22 +08:00
|
|
|
)
|
|
|
|
|
2014-04-30 15:22:54 +08:00
|
|
|
func Test_SendSignal(t *testing.T) {
|
2014-04-30 15:16:07 +08:00
|
|
|
checkPid := os.Getpid()
|
2014-04-25 21:26:22 +08:00
|
|
|
|
2014-05-23 09:31:47 +08:00
|
|
|
p, _ := NewProcess(int32(checkPid))
|
2017-06-03 04:51:00 +08:00
|
|
|
err := p.SendSignal(unix.SIGCONT)
|
2014-04-25 21:26:22 +08:00
|
|
|
if err != nil {
|
|
|
|
t.Errorf("send signal %v", err)
|
|
|
|
}
|
|
|
|
}
|