diff options
author | Craig Small <csmall@enc.com.au> | 2014-07-01 18:51:21 +1000 |
---|---|---|
committer | Craig Small <csmall@enc.com.au> | 2014-07-01 18:51:21 +1000 |
commit | cacba5613ec3333e6536820a0453ae67026eafde (patch) | |
tree | f4fb4e43c87f2b174b797ef39d7a5c2e91e44bfa /testsuite/pkill.test | |
parent | 96c330e3b33aeec75d5210b8bd9e4c33e4135a13 (diff) | |
download | procps-ng-cacba5613ec3333e6536820a0453ae67026eafde.tar.gz |
Reliably kill test processes
It seems command -v also includes built-ins so checking for kill
is useless because it finds the built-in and those machines or
environments that have no /bin/kill fail at the check stage.
Oh and then TCL exec doesn't spawn a shell.
After reading way too many TCL websites, I believe this should
fix the problem. TCL quoting is... different to say the least but
it works reliably here. The script now even picked up a typo elsewhere
which was nice.
This change should stop the intermittent FTBFS bugs from the Debian
pbuilders, I hope! You'd think kill $var wouldn't be this difficult.
Diffstat (limited to 'testsuite/pkill.test')
-rw-r--r-- | testsuite/pkill.test/pkill.exp | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/testsuite/pkill.test/pkill.exp b/testsuite/pkill.test/pkill.exp index 2c9f91e..5eece7d 100644 --- a/testsuite/pkill.test/pkill.exp +++ b/testsuite/pkill.test/pkill.exp @@ -16,12 +16,6 @@ set test "pkill with no arguments" spawn $pkill expect_pass "$test" "^\(lt-\)\?pkill: 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 } ] ] @@ -132,6 +126,4 @@ untested "$test" # Cleanup -eval exec "$kill_path $testproc1_pid" -eval exec "$kill_path $testproc2_pid" -exec rm $testproc_path +kill_testproc |