2014-04-25 21:26:22 +08:00
|
|
|
// +build linux freebsd
|
|
|
|
|
2014-05-20 15:38:20 +08:00
|
|
|
package test
|
2014-04-25 21:26:22 +08:00
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
"syscall"
|
|
|
|
"testing"
|
2014-05-20 15:38:20 +08:00
|
|
|
|
|
|
|
"github.com/shirou/gopsutil"
|
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-20 15:38:20 +08:00
|
|
|
p, _ := gopsutil.NewProcess(int32(checkPid))
|
2014-04-30 15:16:07 +08:00
|
|
|
err := p.SendSignal(syscall.SIGCONT)
|
2014-04-25 21:26:22 +08:00
|
|
|
if err != nil {
|
|
|
|
t.Errorf("send signal %v", err)
|
|
|
|
}
|
|
|
|
}
|