Commit Graph

10 Commits

Author SHA1 Message Date
Craig Small
4090fa711b build-sys: Enable testing of sigqueue
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
2020-04-28 19:47:39 +10:00
Arun Chandrasekaran
2b804a532a kill: use sigqueue to pass value with the signal.
New -q/--queue option for kill so it will send an integer to the
signalled process. See sigqueue(3) for details.

References:
 https://pubs.opengroup.org/onlinepubs/009695399/functions/sigqueue.html
 procps-ng/procps!32

Signed-off-by: Craig Small <csmall@dropbear.xyz>
2020-04-24 19:22:47 +10:00
Craig Small
536cea324b kill: -l space between name parses correctly
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-parameters
 https://bugs.debian.org/854407
2017-02-07 22:05:18 +11:00
Olof Sivertsson
586bfb7655 kill: Fix free() with bad pointer on SIG-prefixed signal-name
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.
2016-09-08 22:32:18 +02:00
Craig Small
1ec2b0eeb1 testsuite: kill test fails on signal names
Some archs have + and - in their signal names, such as hppa
which comes with signals such as RTMIN+-9 RTMIN+-8
The kill -l test failed because of this, we now accept these
odd names.

References:
 https://bugs.debian.org/762764
 https://buildd.debian.org/status/fetch.php?pkg=procps&arch=hppa&ver=1%3A3.3.10-1&stamp=1411601407
2016-01-03 18:20:45 +11:00
Gilles Espinasse
53b253b75a skip kill test too if running runtest
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>
2013-05-26 07:25:55 +10:00
Craig Small
532dc9239d Updated testsuite files for new NLS output 2012-01-02 17:39:41 +11:00
Sami Kerola
5277341278 tests: clean up kill temporary file
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-12-03 20:20:27 +01:00
Craig Small
e7a0fe5bee Fixing tests due to some results
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
2011-12-04 00:50:36 +11:00
Craig Small
f05e15e830 More testing added for procps 2011-11-30 23:11:35 +11:00