From: Gilles Espinasse Date: Wed, 27 Jun 2012 21:21:50 +0000 (+0200) Subject: Run pgrep and pkill tests whithout host ps X-Git-Tag: v3.3.4~52 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=664eaaebc646a8d0d6a64e790572c2ee91a5f977;p=procps-ng 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 --- diff --git a/testsuite/pgrep.test/pgrep.exp b/testsuite/pgrep.test/pgrep.exp index 02340994..0ec52c37 100644 --- a/testsuite/pgrep.test/pgrep.exp +++ b/testsuite/pgrep.test/pgrep.exp @@ -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 diff --git a/testsuite/pkill.test/pkill.exp b/testsuite/pkill.test/pkill.exp index b9f5ddd2..9e0b7e27 100644 --- a/testsuite/pkill.test/pkill.exp +++ b/testsuite/pkill.test/pkill.exp @@ -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