procps/testsuite/pwdx.test/pwdx.exp

21 lines
491 B
Plaintext
Raw Normal View History

2011-11-23 16:14:51 +05:30
2011-11-23 17:18:49 +05:30
set pwdx "${topdir}pwdx"
2011-11-23 16:14:51 +05:30
# Run pwdx with no arguments
set test "pwdx no args"
2011-11-30 17:41:35 +05:30
spawn $pwdx
expect_pass "$test" "^Usage: pwdx pid\.\.\."
2011-11-23 16:14:51 +05:30
# 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"
2011-11-23 16:14:51 +05:30
# Run pwdx with existing pid
set test "pwdx finds sleep in cwd"
set sleep_pid [ exec sleep 600 & ]
set sleep_pwd [ pwd ]
2011-11-30 17:41:35 +05:30
spawn $pwdx $sleep_pid
expect_pass "$test" "^$sleep_pid: $sleep_pwd"
exec kill $sleep_pid
2011-11-23 16:14:51 +05:30