2011-11-30 23:11:35 +11:00
|
|
|
#
|
|
|
|
# Dejagnu testsuite for kill - part of procps
|
|
|
|
#
|
|
|
|
set kill ${topdir}kill
|
|
|
|
|
2013-05-26 07:25:55 +10:00
|
|
|
if { ![ file exists $kill ] } {
|
|
|
|
untested { skipping (not build)}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2011-11-30 23:11:35 +11:00
|
|
|
set test "kill with no arguments"
|
|
|
|
spawn $kill
|
2020-04-24 19:22:47 +10:00
|
|
|
expect_pass "$test" "Usage:\\s+\(lt-\)?kill \\\[options\\\] <pid>"
|
2011-11-30 23:11:35 +11:00
|
|
|
|
|
|
|
set test "kill list signal names"
|
|
|
|
spawn $kill -l
|
2016-01-03 18:20:45 +11:00
|
|
|
expect_pass "$test" "^\(\[A-Z12+-\]\\s*\)+$"
|
2011-11-30 23:11:35 +11:00
|
|
|
|
|
|
|
set test "kill list signal names in table"
|
|
|
|
spawn $kill -L
|
2016-01-03 18:20:45 +11:00
|
|
|
expect_pass "$test" "^\(\\s+\\d+ \[A-Z12+-\]+\)+\\s*$"
|
2011-11-30 23:11:35 +11:00
|
|
|
|
2017-02-07 22:05:18 +11:00
|
|
|
set test "kill convert signal name to number no space"
|
2012-01-02 17:39:41 +11:00
|
|
|
spawn $kill -lHUP
|
2011-11-30 23:11:35 +11:00
|
|
|
expect_pass "$test" "^1\\s*"
|
|
|
|
|
2017-02-07 22:05:18 +11:00
|
|
|
set test "kill convert signal name to number with space"
|
|
|
|
spawn $kill -l HUP
|
|
|
|
expect_pass "$test" "^1\\s*"
|
|
|
|
|
|
|
|
set test "kill convert SIG-prefixed signal name to number no space"
|
2016-09-08 08:32:43 +02:00
|
|
|
spawn $kill -lSIGHUP
|
|
|
|
expect_pass "$test" "^1\\s*$"
|
|
|
|
|
2017-02-07 22:05:18 +11:00
|
|
|
set test "kill convert SIG-prefixed signal name to number with space"
|
|
|
|
spawn $kill -l SIGHUP
|
|
|
|
|
|
|
|
expect_pass "$test" "^1\\s*$"
|
|
|
|
|
|
|
|
set test "kill convert signal number to name no space"
|
|
|
|
spawn $kill -l1
|
|
|
|
expect_pass "$test" "^HUP\\s*"
|
|
|
|
|
|
|
|
set test "kill convert signal number to name with space"
|
2011-11-30 23:11:35 +11:00
|
|
|
spawn $kill -l 1
|
|
|
|
expect_pass "$test" "^HUP\\s*"
|
|
|
|
|
2011-12-04 00:50:36 +11:00
|
|
|
#set test "kill numbered process"
|
|
|
|
#make_testproc
|
|
|
|
#if { [ file isdirectory "/proc/$testproc1_pid" ] && [ file isdirectory "/proc/$testproc2_pid" ] } {
|
|
|
|
#} else {
|
|
|
|
# perror "Could not start test processes"
|
|
|
|
#}
|
|
|
|
#exec $kill -KILL $testproc1_pid
|
|
|
|
#wait
|
|
|
|
#if { [ file exists "/proc/$testproc1_pid" ] } {
|
|
|
|
# exec kill $testproc2_pid
|
|
|
|
# fail "$test (proc 1 exists)"
|
|
|
|
#} else {
|
|
|
|
# exec $kill -KILL $testproc2_pid
|
|
|
|
# wait
|
|
|
|
# if { [ file exists "/proc/$testproc2_pid" ] } {
|
|
|
|
# exec kill $testproc2_pid
|
|
|
|
# fail "$test (proc 2 exists)"
|
|
|
|
# } else {
|
|
|
|
# pass "$test"
|
|
|
|
# }
|
|
|
|
#}
|
2011-12-03 15:53:47 +01:00
|
|
|
## Cleanup
|
|
|
|
#exec rm $testproc_path
|