if LINUX
# Programs that are expected across the board
-DEJATOOL = \
+test_tools = \
free \
pgrep \
pkill \
sysctl slabtop pmap kill
endif
+
+DEJATOOL = $(test_tools)
EXTRA_DIST = \
#
set kill ${topdir}kill
-
set test "kill with no arguments"
spawn $kill
expect_pass "$test" "Usage:\\s+kill pid ...\\s+Send SIGTERM to every process listed.\\r\\s+kill signal pid ...\\s+Send a signal to every process listed.\\r\\s+kill -s signal pid ...\\s+Send a signal to every process listed.\\r\\s+kill -l\\s+List all signal names.\\r\\s+kill -L\\s+List all signal names in a nice table.\\r\\s+kill -l signal\\s+Convert between signal numbers and names."
spawn $kill -l 1
expect_pass "$test" "^HUP\\s*"
-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"
-}
-set foo [ exec $kill -KILL $testproc1_pid $testproc2_pid ]
-wait
-wait
-if { [ file exists "/proc/$testproc1_pid" ] || [ file exists "/proc/$testproc2_pid" ] } {
- fail "$test"
-} else {
- pass "$test"
-}
+#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"
+# }
+#}
spawn $pwdx
expect_pass "$test" "^Usage: pwdx pid\.\.\."
-# Run pwdx with pid 1 which is not reachable
-set test "pwdx pid 1 should give permission denied"
-spawn $pwdx 1
-expect_pass "$test" "^1: Permission denied"
+# Run pwdx with pid 0 which is invalid
+set test "pwdx pid 0 should be invalid"
+spawn $pwdx 0
+expect_pass "$test" "^pwdx: invalid process id"
# Run pwdx with existing pid
set test "pwdx finds sleep in cwd"
set test "uptime"
spawn $uptime
-expect_pass "$test" "^\\s+\\d{2}:\\d{2}:\\d{2} up (\\d+ days?,)?\\s*\\d+(min|:\\d+), +\\d+ users, +load average: \[0-9.\]+, \[0-9.\]+, \[0-9.\]+\\s*$"
+expect_pass "$test" "^\\s+\\d{2}:\\d{2}:\\d{2} up (\\d+ days?,)?\\s*\\d+(min|:\\d+), +\\d+ users?, +load average: \[0-9.\]+, \[0-9.\]+, \[0-9.\]+\\s*$"
# Need a partition
set diskstats [ exec cat /proc/diskstats ]
regexp "\\s+\\d+\\s+\\d+\\s+\(\[a-z\]+\\d+\)" $diskstats -> partition
-set test "vmstat partition"
+set test "vmstat partition (using $partition)"
spawn $vmstat -p $partition
expect_pass "$test" "^${partition}\\s+reads"
#\\s+read sectors\\s+writes\\s+requested writes"
# FIXME - the user lines only go to idle
set w "${topdir}w"
-set w_uptime "\\s+\\d{2}:\\d{2}:\\d{2} up (\\d+ days?,)?\\s*\\d+(min|:\\d+), +\\d+ users, +load average: \[0-9.\]+, \[0-9.\]+, \[0-9.\]+\\s+"
+set w_uptime "\\s+\\d{2}:\\d{2}:\\d{2} up (\\d+ days?,)?\\s*\\d+(min|:\\d+), +\\d+ users?, +load average: \[0-9.\]+, \[0-9.\]+, \[0-9.\]+\\s+"
set w_std_header "${w_uptime}USER\\s+TTY\\s+LOGIN@\\s+IDLE\\s+JCPU\\s+PCPU\\s+WHAT\\s+"
set w_short_header "${w_uptime}USER\\s+TTY\\s+IDLE\\s+WHAT\\s+"
set w_from_header "${w_uptime}USER\\s+TTY\\s+FROM\\s+LOGIN@\\s+IDLE\\s+JCPU\\s+PCPU\\s+WHAT\\s+"