Run pgrep and pkill tests whithout host ps

When ps is not available (like it may happen in a chroot), pgrep.exp and pkill.exp tests fail.
Use just build ps instead.

Signed-off-by: Gilles Espinasse <g.esp@free.fr>
This commit is contained in:
Gilles Espinasse 2012-06-27 23:21:50 +02:00 committed by Craig Small
parent ecc265492f
commit 664eaaebc6
2 changed files with 4 additions and 2 deletions

View File

@ -8,6 +8,7 @@ set uid [ exec id -u ]
set not_uid [ expr { $uid + 1 } ]
set gid [ exec id -g ]
set not_gid [ expr { $gid + 1 } ]
set ps "${topdir}ps/pscommand"
set raw_tty [ exec tty ]
regexp "/dev/(.+)" $raw_tty > tty
@ -15,7 +16,7 @@ make_testproc
set testproc_len [ string length $testproc_comm ]
set testproc_trim [ string range $testproc_comm 0 [ expr { $testproc_len - 2 } ] ]
set testproc1_sid [ string trim [ exec ps --no-headers -o sid $testproc1_pid ] ]
set testproc1_sid [ string trim [ exec $ps --no-headers -o sid $testproc1_pid ] ]
set test "pgprep with no arguments"
spawn $pgrep

View File

@ -8,13 +8,14 @@ set uid [ exec id -u ]
set not_uid [ expr { $uid + 1 } ]
set gid [ exec id -g ]
set not_gid [ expr { $gid + 1 } ]
set ps "${topdir}ps/pscommand"
set raw_tty [ exec tty ]
regexp "/dev/(.+)" $raw_tty > tty
make_testproc
set testproc_len [ string length $testproc_comm ]
set testproc_trim [ string range $testproc_comm 0 [ expr { $testproc_len - 2 } ] ]
set testproc1_sid [ exec ps --no-headers -o sid $testproc1_pid ]
set testproc1_sid [ exec $ps --no-headers -o sid $testproc1_pid ]
set test "pkill with no arguments"
spawn $pkill