X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=tests%2Futils%2Futils.sh;h=dbb0b4b68ebac8ff17560d68cf0a075c0ef2fb52;hb=3db6ba399d017418a91045284743fe5d55716d4a;hp=63f13aa24e8d31d0677c42dc8404937388a29741;hpb=74a6c3f57109f5924f734f66ead8ee1915a48803;p=lttng-tools.git diff --git a/tests/utils/utils.sh b/tests/utils/utils.sh index 63f13aa24..dbb0b4b68 100644 --- a/tests/utils/utils.sh +++ b/tests/utils/utils.sh @@ -66,11 +66,24 @@ function full_cleanup () # The '-' before the pid number ($$) indicates 'kill' to signal the # whole process group. trap - SIGTERM && kill -- -$$ + exit 1 } +function null_pipes () +{ + exec 0>/dev/null + exec 1>/dev/null + exec 2>/dev/null +} trap full_cleanup SIGINT SIGTERM +# perl prove closes its child pipes before giving it a chance to run its +# signal trap handlers. Redirect pipes to /dev/null if SIGPIPE is caught +# to allow those trap handlers to proceed. + +trap null_pipes SIGPIPE + function print_ok () { # Check if we are a terminal @@ -1673,7 +1686,7 @@ function regenerate_statedump () test "$ret" -ne "0" ok $? "Expected fail on regenerate statedump $sess_name" else - ok $ret "Metadata regenerate $sess_name" + ok $ret "Statedump regenerate $sess_name" fi }