From 664eaaebc646a8d0d6a64e790572c2ee91a5f977 Mon Sep 17 00:00:00 2001 From: Gilles Espinasse Date: Wed, 27 Jun 2012 23:21:50 +0200 Subject: [PATCH] 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 --- testsuite/pgrep.test/pgrep.exp | 3 ++- testsuite/pkill.test/pkill.exp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) 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