The referenced commits enavled both pkill and kill to send an integer to
the killed or signalled process. The test_process now will report on the
integer if sent and the testsuite changes take advantage of this
new feature.
Another process make/destroy set had to be made as using spawn
instead of exec changes both the SID and TTY for the underlying
process, making other tests fail.
References:
commit 7d55409b82
commit 2b804a532a
This was supposed to be just a cherry-pick of the referenced
commit. However there were two problems:
1. kill code was moved out to its own file
2. strtosig() had a latent bug where signal numbers were not
converted to names.
Original note:
kill -lHUP would work correctly, but kill -l HUP would not.
The list option in kill was hit by a quirk of getopt_long where an
option with an optional argument would not attempt to get the argument
beyond the space, even though a mandatory argument would do that.
The fix is a kludge to scan to the next argument and if it looks
like something we can use, use it. Lucky for us, the list option is
one where parsing can stop immediately.
Thanks to Brian Vandenberg for the way forward.
References:
http://stackoverflow.com/questions/1052746/getopt-does-not-parse-optional-arguments-to-parametershttps://bugs.debian.org/854407
commit 537cea324b121f54744369425332c256aa84a181
kill -l SIGHUP (or any other signal-name prefixed with "SIG")
would cause free() to be called with a bad pointer instead of
a pointer to what was allocated. Fix this and add test-case.
I find more readable instead of make check to run
cd testsuite && make site.exp && DEJAGNU=global-conf.exp runtest
But in that case, kill.exp was still trying to run with
ERROR: tcl error sourcing ./kill.test/kill.exp.
ERROR: couldn't execute "/usr/src/procps-ng-3.3.7/kill": no such file or
directory
...
Simply return from test if kill is not build
Signed-off-by: Gilles Espinasse <g.esp@free.fr>
Makefile will now only test for Linux systems, a work around in the
makefile due to some silly redefine restrictions.
uptime and w now won't error due to being one user logged in, thanks to
Sami for the patch
kill processes by pid test commented out due to false negatives
pwdx process 1 check also commented out due to false negatives