blob: 8bb3889cbdd56562c2715101008fba2391681fe7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
#
# Testsuite for killall
#
set killall "${topdir}src/killall"
set fake_proc_name "afakeprocname"
set test "killall with no arguments"
spawn $killall
expect_pass "$test" "^Usage: killall \\\[OPTION\\\]\\.\\.\\. \\\[--\\\] NAME\\.\\.\\."
set test "killall list signals"
spawn $killall -l
expect_pass "$test" "^(\[A-Z12\]+\\s*)+$"
set test "killall process not found"
spawn $killall ${fake_proc_name}
expect_pass "$test" "${fake_proc_name}: no process found"
set test "killall using -ve"
spawn $killall -ve ${fake_proc_name}
expect_pass "$test" "${fake_proc_name}: no process found"
set signals [regexp -all -inline {\w+} [exec $killall -l]]
foreach signame $signals {
set test "killall using signal $signame"
spawn $killall -$signame ${fake_proc_name}
expect_pass "$test" "${fake_proc_name}: no process found"
set test "killall using signal SIG$signame"
spawn $killall -SIG$signame ${fake_proc_name}
expect_pass "$test" "${fake_proc_name}: no process found"
}
|