2011-11-23 21:44:51 +11:00
|
|
|
|
2011-11-23 22:48:49 +11:00
|
|
|
set pwdx "${topdir}pwdx"
|
2011-11-23 21:44:51 +11:00
|
|
|
# Run pwdx with no arguments
|
|
|
|
set test "pwdx no args"
|
2011-11-30 23:11:35 +11:00
|
|
|
spawn $pwdx
|
2012-01-02 17:39:41 +11:00
|
|
|
expect_pass "$test" "^\\s*Usage:\\s+\(lt-\)\?pwdx \\\[options\\\] pid\.\.\."
|
2011-11-23 21:44:51 +11:00
|
|
|
|
2011-12-04 00:50:36 +11:00
|
|
|
# Run pwdx with pid 0 which is invalid
|
|
|
|
set test "pwdx pid 0 should be invalid"
|
|
|
|
spawn $pwdx 0
|
2012-02-09 21:18:14 +01:00
|
|
|
expect_pass "$test" "\(lt-\)\?pwdx\: invalid process id\: 0"
|
2011-11-23 21:44:51 +11:00
|
|
|
|
|
|
|
# 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 23:11:35 +11:00
|
|
|
spawn $pwdx $sleep_pid
|
|
|
|
expect_pass "$test" "^$sleep_pid: $sleep_pwd"
|
|
|
|
exec kill $sleep_pid
|
2011-11-23 21:44:51 +11:00
|
|
|
|