diff options
author | Craig Small <csmall@enc.com.au> | 2013-10-09 19:18:55 +1100 |
---|---|---|
committer | Craig Small <csmall@enc.com.au> | 2013-10-09 19:18:55 +1100 |
commit | 422a4a5e6756c8e7864318ce72a9dd85ae083bf8 (patch) | |
tree | 9f62db3c1c14e6c27926f7f839e1b543fff2110b /testsuite/pgrep.test | |
parent | e6a78f2745ca6c7ceed4406d3ce5397e77518b11 (diff) | |
download | procps-ng-422a4a5e6756c8e7864318ce72a9dd85ae083bf8.tar.gz |
Skip some tests if kill cannot be found
Some Debian pbuilders error out on some of the tests because
they cannot find kill to kill the test processes. Now if we
cannot find kill we skip those lot of tests.
Still need to work out why the S390 doesn't like test_sched
References: http://bugs.debian.org/725743
Diffstat (limited to 'testsuite/pgrep.test')
-rw-r--r-- | testsuite/pgrep.test/pgrep.exp | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/testsuite/pgrep.test/pgrep.exp b/testsuite/pgrep.test/pgrep.exp index 0cb6db7..248c45f 100644 --- a/testsuite/pgrep.test/pgrep.exp +++ b/testsuite/pgrep.test/pgrep.exp @@ -12,16 +12,22 @@ set ps "${topdir}ps/pscommand" set raw_tty [ exec tty ] regexp "/dev/(.+)" $raw_tty > tty +set test "pgprep with no arguments" +spawn $pgrep +expect_pass "$test" "^\(lt-\)\?pgrep: no matching criteria specified\\s*" + +# Tests that don't need the test process go above here +if { [ catch { exec sh -c "command -v kill" } kill_path] } { + untested { kill path not found } + return +} + 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 test "pgprep with no arguments" -spawn $pgrep -expect_pass "$test" "^\(lt-\)\?pgrep: no matching criteria specified\\s*" - set test "pgrep find both test pids" spawn $pgrep $testproc_comm expect_pass "$test" "^$testproc1_pid\\s+$testproc2_pid\\s*$" @@ -117,6 +123,6 @@ expect_blank $test # Cleanup -exec kill $testproc1_pid -exec kill $testproc2_pid -exec rm $testproc_path +eval exec "$kill_path $testproc1_pid" +eval exec "$kill_path $testproc2_pid" +file delete $testproc_path |