]> granicus.if.org Git - procps-ng/commitdiff
Run pgrep and pkill tests whithout host ps
authorGilles Espinasse <g.esp@free.fr>
Wed, 27 Jun 2012 21:21:50 +0000 (23:21 +0200)
committerCraig Small <csmall@enc.com.au>
Thu, 28 Jun 2012 11:53:22 +0000 (21:53 +1000)
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>
testsuite/pgrep.test/pgrep.exp
testsuite/pkill.test/pkill.exp

index 0234099401299b8e29e1bb1941426158f1d570a6..0ec52c3798f8c9f4dc5b86967b3be19b68063578 100644 (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
index b9f5ddd2d1f88956a0af4499dcf9bdad78b7d73a..9e0b7e2744ae0351be01cca02f9240e4e34e96ca 100644 (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