From 41a4c714e49e26f290e0c2e27a61d9086e633b52 Mon Sep 17 00:00:00 2001 From: Pádraig Brady Date: Mon, 9 Nov 2015 18:50:21 +0000 Subject: tests: cleanup trapping of signal names A side effect of this cleanup is we no longer depend on our own kill command being built. * init.cfg (require_trap_signame_): A new function to verify that the shell supports specifying traps by signal name. (require_kill_group_): A new function to ensure the shell supports sending a signal to a group. * tests/du/move-dir-while-traversing.sh: Ensure trap supports signal names. * tests/misc/stty-invalid.sh: Likewise. * tests/misc/stty-pairs.sh: Likewise. * tests/misc/stty-row-col.sh: Likewise. * tests/misc/stty.sh: Likewise. * tests/misc/sort-compress.sh: Likewise. Also simplify trap call. * tests/install/trap.sh: Likewise. * tests/misc/timeout.sh: Likewise. * tests/dd/stats.sh: Likewise. Also use default kill command. * tests/misc/timeout-group.sh: Likewise. --- init.cfg | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'init.cfg') diff --git a/init.cfg b/init.cfg index ef450d790..6f5f80bf3 100644 --- a/init.cfg +++ b/init.cfg @@ -470,6 +470,20 @@ require_proc_pid_status_() kill $pid } +# Does trap support signal names? +# Old versions of ash did not. +require_trap_signame_() +{ + (trap '' CHLD) || skip_ 'requires trap with signal name support' +} + +# Does kill support sending signal to whole group? +# dash 0.5.8 at least does not. +require_kill_group_() +{ + kill -0 -- -1 || skip_ 'requires kill with group signalling support' +} + # Return nonzero if the specified path is on a file system for # which FIEMAP support exists. Note some file systems (like ext3 and btrfs) # only support FIEMAP for files, not directories. -- cgit v1.2.3-54-g00ecf