From 89cd27c623e929e837a02eef0622c4ef33772ade Mon Sep 17 00:00:00 2001 From: Ryota MIBU Date: Fri, 27 Jan 2017 05:13:46 +0000 Subject: Fix functions for fuel installer JIRA: DOCTOR-58 Change-Id: Ic9326791007a3afa754cc64423b46adc17c59dc0 Signed-off-by: Ryota MIBU --- tests/functions-common | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tests/functions-common') diff --git a/tests/functions-common b/tests/functions-common index 08d489e5..7928f20c 100644 --- a/tests/functions-common +++ b/tests/functions-common @@ -4,7 +4,7 @@ # is_set env-var function is_set { local var=\$"$1" - eval "[ -n \"$var\" ]" + eval "[[ -n \"$var\" ]]" } # Prints backtrace info @@ -41,6 +41,8 @@ function err { # die $LINENO "message" function die { local exitcode=$? + local xtrace + xtrace=$(set +o | grep xtrace) set +o xtrace local line=$1; shift if [ $exitcode == 0 ]; then @@ -50,6 +52,7 @@ function die { err $line "$*" # Give buffers a second to flush sleep 1 + $xtrace exit $exitcode } -- cgit 1.2.3-korg