procps/testsuite/pwdx.test/pwdx.exp
Craig Small e7a0fe5bee Fixing tests due to some results
Makefile will now only test for Linux systems, a work around in the
makefile due to some silly redefine restrictions.

uptime and w now won't error due to being one user logged in, thanks to
Sami for the patch

kill processes by pid test commented out due to false negatives

pwdx process 1 check also commented out due to false negatives
2011-12-04 00:50:36 +11:00

21 lines
491 B
Plaintext

set pwdx "${topdir}pwdx"
# Run pwdx with no arguments
set test "pwdx no args"
spawn $pwdx
expect_pass "$test" "^Usage: pwdx pid\.\.\."
# 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 sleep_pid [ exec sleep 600 & ]
set sleep_pwd [ pwd ]
spawn $pwdx $sleep_pid
expect_pass "$test" "^$sleep_pid: $sleep_pwd"
exec kill $sleep_pid