summaryrefslogtreecommitdiffstats
path: root/testsuite/killall.test/killall.exp
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/killall.test/killall.exp')
-rw-r--r--testsuite/killall.test/killall.exp32
1 files changed, 32 insertions, 0 deletions
diff --git a/testsuite/killall.test/killall.exp b/testsuite/killall.test/killall.exp
new file mode 100644
index 0000000..8bb3889
--- /dev/null
+++ b/testsuite/killall.test/killall.exp
@@ -0,0 +1,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"
+}