2011-11-30 17:41:35 +05:30
|
|
|
#
|
|
|
|
# Dejagnu testsuite for kill - part of procps
|
|
|
|
#
|
2022-08-29 14:43:10 +05:30
|
|
|
set kill ${topdir}src/kill
|
2011-11-30 17:41:35 +05:30
|
|
|
|
2013-05-26 02:55:55 +05:30
|
|
|
if { ![ file exists $kill ] } {
|
|
|
|
untested { skipping (not build)}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2011-11-30 17:41:35 +05:30
|
|
|
set test "kill with no arguments"
|
|
|
|
spawn $kill
|
2020-04-24 14:52:47 +05:30
|
|
|
expect_pass "$test" "Usage:\\s+\(lt-\)?kill \\\[options\\\] <pid>"
|
2011-11-30 17:41:35 +05:30
|
|
|
|
|
|
|
set test "kill list signal names"
|
|
|
|
spawn $kill -l
|
2016-01-03 12:50:45 +05:30
|
|
|
expect_pass "$test" "^\(\[A-Z12+-\]\\s*\)+$"
|
2011-11-30 17:41:35 +05:30
|
|
|
|
|
|
|
set test "kill list signal names in table"
|
|
|
|
spawn $kill -L
|
2016-01-03 12:50:45 +05:30
|
|
|
expect_pass "$test" "^\(\\s+\\d+ \[A-Z12+-\]+\)+\\s*$"
|
2011-11-30 17:41:35 +05:30
|
|
|
|
2017-05-22 17:45:59 +05:30
|
|
|
set test "kill convert signal name to number no space"
|
2012-01-02 12:09:41 +05:30
|
|
|
spawn $kill -lHUP
|
2011-11-30 17:41:35 +05:30
|
|
|
expect_pass "$test" "^1\\s*"
|
|
|
|
|
2017-05-22 17:45:59 +05:30
|
|
|
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 12:02:43 +05:30
|
|
|
spawn $kill -lSIGHUP
|
|
|
|
expect_pass "$test" "^1\\s*$"
|
|
|
|
|
2017-05-22 17:45:59 +05:30
|
|
|
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 17:41:35 +05:30
|
|
|
spawn $kill -l 1
|
|
|
|
expect_pass "$test" "^HUP\\s*"
|
|
|
|
|
2020-04-28 15:10:07 +05:30
|
|
|
make_pipeproc
|
|
|
|
|
|
|
|
set test "kill with SIGUSR1"
|
|
|
|
spawn $kill -USR1 $pipeproc_pid
|
|
|
|
expect_blank_continue "$test"
|
|
|
|
expect_pipeproc_pass "$test" "SIG SIGUSR1"
|
|
|
|
|
|
|
|
set test "kill with long SIGUSR2"
|
|
|
|
spawn $kill -s SIGUSR2 $pipeproc_pid
|
|
|
|
expect_blank_continue "$test"
|
|
|
|
expect_pipeproc_pass "$test" "SIG SIGUSR2"
|
|
|
|
|
|
|
|
set test "kill with queued int"
|
|
|
|
spawn $kill -USR1 -q 42 $pipeproc_pid
|
|
|
|
expect_blank_continue "$test"
|
|
|
|
expect_pipeproc_pass "$test" "SIG SIGUSR1 value=42"
|
|
|
|
|
|
|
|
kill_pipeproc
|