From 5a911faae25784a91fc085debeb6dbe8512d80b6 Mon Sep 17 00:00:00 2001 From: Andreas Dilger Date: Sat, 14 Sep 2019 01:46:44 -0600 Subject: [PATCH] LU-12760 tests: stack_trap defaults to sigspec=EXIT If the "sigspec" argument is not specified for stack_trap(), default to "EXIT" as the signal, since this is what we use for all callers of stack_trap() today anyway. Test-Parameters: trivial Signed-off-by: Andreas Dilger Change-Id: I2c8d986cdf8743e1d956cd7941a47bd4cd772592 Reviewed-on: https://review.whamcloud.com/36186 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Oleg Drokin Reviewed-by: James Nunez Reviewed-by: Li Xi --- lustre/tests/test-framework.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index 17274af..31e7ec3 100755 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -6063,7 +6063,7 @@ report_error() { # usage: stack_trap arg sigspec # # stack_trap() behaves like bash's built-in trap, except that it "stacks" the -# command ``arg`` on top of previously defined commands for ``sigspec`` instead +# command "arg" on top of previously defined commands for "sigspec" instead # of overwriting them. # stacked traps are executed in reverse order of their registration # @@ -6071,7 +6071,7 @@ report_error() { stack_trap() { local arg="$1" - local sigspec="$2" + local sigspec="${2:-EXIT}" # Use "trap -p" to get the quoting right local old_trap="$(trap -p "$sigspec")" -- 1.8.3.1