testsuite fixes
This commit is contained in:
2
testsuite/.gitignore
vendored
Normal file
2
testsuite/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
*.log
|
||||
*.sum
|
5
testsuite/Makefile.am
Normal file
5
testsuite/Makefile.am
Normal file
@ -0,0 +1,5 @@
|
||||
AUTOMAKE_OPTIONS = dejagnu
|
||||
export DEJAGNU
|
||||
|
||||
DEJATOOL = \
|
||||
pwdx
|
8
testsuite/config/unix.exp
Normal file
8
testsuite/config/unix.exp
Normal file
@ -0,0 +1,8 @@
|
||||
|
||||
proc pwdx_load { arg } { }
|
||||
proc pwdx_exit {} {}
|
||||
proc pwdx_version {} {
|
||||
set tmp [ exec pwdx -V ]
|
||||
regexp "procps-ng version (\[0-9.\]*)" $tmp tmp version
|
||||
clone_output "pwdx version $version\n"
|
||||
}
|
30
testsuite/pwdx.test/pwdx.exp
Normal file
30
testsuite/pwdx.test/pwdx.exp
Normal file
@ -0,0 +1,30 @@
|
||||
|
||||
# Run pwdx with no arguments
|
||||
set test "pwdx no args"
|
||||
spawn pwdx
|
||||
expect {
|
||||
-re "^Usage: pwdx pid\.\.\." { pass "$test" }
|
||||
eof { fail "$test" }
|
||||
timeout { fail "$test" }
|
||||
}
|
||||
|
||||
# Run pwdx with pid 1 which is not reachable
|
||||
set test "pwdx pid 1 should give permission denied"
|
||||
spawn pwdx 1
|
||||
expect {
|
||||
-re "^1: Permission denied" { pass "$test" }
|
||||
eof { fail "$test" }
|
||||
timeout { fail "$test" }
|
||||
}
|
||||
|
||||
# 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 {
|
||||
-re "^$sleep_pid: $sleep_pwd" { pass "$test" }
|
||||
eof { fail "$test" }
|
||||
timeout { fail "$test" }
|
||||
}
|
||||
|
Reference in New Issue
Block a user