projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: tests: quote variable in case it's not set
[lttng-tools.git]
/
tests
/
utils
/
utils.sh
diff --git
a/tests/utils/utils.sh
b/tests/utils/utils.sh
index 0278bcf5e8eebc006bb1e2d7b10fc39e4e8e1f7e..ea40fce9b5cd9131ed68e3c7de4fdd2cda9eaa3f 100644
(file)
--- a/
tests/utils/utils.sh
+++ b/
tests/utils/utils.sh
@@
-46,7
+46,7
@@
export LTTNG_SESSIOND_PATH="/bin/true"
source $TESTDIR/utils/tap/tap.sh
source $TESTDIR/utils/tap/tap.sh
-if [ -z $
LTTNG_TEST_TEARDOWN_TIMEOUT
]; then
+if [ -z $
{LTTNG_TEST_TEARDOWN_TIMEOUT+x}
]; then
LTTNG_TEST_TEARDOWN_TIMEOUT=60
fi
LTTNG_TEST_TEARDOWN_TIMEOUT=60
fi
@@
-66,6
+66,7
@@
function full_cleanup ()
# The '-' before the pid number ($$) indicates 'kill' to signal the
# whole process group.
trap - SIGTERM && kill -- -$$
# The '-' before the pid number ($$) indicates 'kill' to signal the
# whole process group.
trap - SIGTERM && kill -- -$$
+ exit 1
}
function null_pipes ()
}
function null_pipes ()
@@
-663,7
+664,7
@@
function stop_lttng_sessiond_opt()
if [ -n "$modules" ]; then
diag "Unloading all LTTng modules"
if [ -n "$modules" ]; then
diag "Unloading all LTTng modules"
- modprobe -
r
"$modules"
+ modprobe -
-remove
"$modules"
fi
fi
fi
fi
fi
fi
@@
-899,7
+900,14
@@
function create_lttng_session ()
local trace_path=$4
local opt=$5
local trace_path=$4
local opt=$5
- $TESTDIR/../src/bin/lttng/$LTTNG_BIN create $sess_name -o $trace_path $opt > $OUTPUT_DEST
+ if [ -z "$trace_path" ]; then
+ # Use lttng-sessiond default output.
+ trace_path=""
+ else
+ trace_path="-o $trace_path"
+ fi
+
+ $TESTDIR/../src/bin/lttng/$LTTNG_BIN create "$sess_name" $trace_path $opt 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
ret=$?
if [ $expected_to_fail -eq "1" ]; then
test "$ret" -ne "0"
ret=$?
if [ $expected_to_fail -eq "1" ]; then
test "$ret" -ne "0"
@@
-1412,7
+1420,7
@@
function lttng_snapshot_record ()
local sess_name=$1
local trace_path=$2
local sess_name=$1
local trace_path=$2
- $TESTDIR/../src/bin/lttng/$LTTNG_BIN snapshot record -s
$sess_name $trace_path
1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
+ $TESTDIR/../src/bin/lttng/$LTTNG_BIN snapshot record -s
"$sess_name" "$trace_path"
1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
ok $? "Snapshot recorded"
}
ok $? "Snapshot recorded"
}
@@
-1795,7
+1803,7
@@
function regenerate_statedump ()
test "$ret" -ne "0"
ok $? "Expected fail on regenerate statedump $sess_name"
else
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
}
fi
}
@@
-1836,7
+1844,7
@@
function rotate_session_fail ()
function destructive_tests_enabled ()
{
function destructive_tests_enabled ()
{
- if [
${LTTNG_ENABLE_DESTRUCTIVE_TESTS}
= "will-break-my-system" ]; then
+ if [
"$LTTNG_ENABLE_DESTRUCTIVE_TESTS"
= "will-break-my-system" ]; then
return 0
else
return 1
return 0
else
return 1
This page took
0.027671 seconds
and
4
git commands to generate.