rearranged testsuite

This commit is contained in:
Craig Small
2011-11-27 18:32:10 +11:00
parent 2cad7c5667
commit 5c48d8b79a
7 changed files with 99 additions and 5 deletions

View File

@@ -14,9 +14,20 @@ proc pwdx_version {} {
proc free_load { arg } { }
proc free_exit {} {}
proc free_version {} {
set tmp [ exec free --version ]
global topdir
set tmp [ exec ${topdir}free --version ]
regexp "procps-ng version (\[0-9.\]*)" $tmp tmp version
clone_output "free version $version\n"
clone_output "${topdir}free version $version\n"
}
# w functions
proc w_load { arg } { }
proc w_exit {} {}
proc w_version {} {
global topdir
set tmp [ exec ${topdir}w -V ]
regexp "procps-ng version (\[0-9.\]*)" $tmp tmp version
clone_output "${topdir}w version $version\n"
}
#
@@ -45,3 +56,19 @@ proc expect_blank { testname } {
timeout { pass "$testname" }
}
}
proc make_testproc { } {
global testproc_path testproc_comm testproc1_pid testproc2_pid
set testproc_path [ exec mktemp -u ]
exec ln -s "/bin/sleep" $testproc_path
set testproc1_pid [ exec $testproc_path 600 & ]
set testproc2_pid [ exec $testproc_path 600 & ]
set testproc_comm [ exec basename $testproc_path ]
spawn readlink $testproc_path
expect {
-re "^/bin/sleep\\s*$" { }
timeout { perror "test proc does not link to sleep 1" }
eof { perror "test proc does not link to sleep 1" }
}
}