# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
TEST_DESC="Streaming Base Path Override - User space tracing"
-CURDIR=$(dirname $0)/
+CURDIR=$(dirname "$0")/
TESTDIR=$CURDIR/../../..
-NR_ITER=5
-NR_USEC_WAIT=0
TESTAPP_PATH="$TESTDIR/utils/testapp"
TESTAPP_NAME="gen-ust-events"
TESTAPP_BIN="$TESTAPP_PATH/$TESTAPP_NAME/$TESTAPP_NAME"
NUM_TESTS=37
-source $TESTDIR/utils/utils.sh
+source "$TESTDIR/utils/utils.sh"
if [ ! -x "$TESTAPP_BIN" ]; then
BAIL_OUT "No UST events binary detected."
function ust_app_stream_base_path ()
{
- local session_name=$(randstring 16 0)
+ local session_name="ust_app_stream_base_path"
local base_path="my/custom/path1"
diag "Test base path override for trace streaming"
destroy_lttng_session_ok $session_name
# validate test
- validate_trace $EVENT_NAME $TRACE_PATH/$HOSTNAME/$base_path
- if [ $? -eq 0 ]; then
+ if validate_trace $EVENT_NAME "$TRACE_PATH/$HOSTNAME/$base_path"; then
# only delete if successful
- rm -rf $TRACE_PATH
+ rm -rf "$TRACE_PATH"
fi
}
function ust_app_snapshot_create_base_path ()
{
- local session_name=$(randstring 16 0)
+ local session_name="ust_app_snapshot_create_base_path"
local base_path="my/custom/path2"
diag "Test base path override for remote trace snapshot (URI on create)"
destroy_lttng_session_ok $session_name
# validate test
- validate_trace $EVENT_NAME $TRACE_PATH/$HOSTNAME/$base_path
- if [ $? -eq 0 ]; then
+ if validate_trace $EVENT_NAME "$TRACE_PATH/$HOSTNAME/$base_path"; then
# only delete if successful
- rm -rf $TRACE_PATH
+ rm -rf "$TRACE_PATH"
fi
}
function ust_app_snapshot_base_path ()
{
- local session_name=$(randstring 16 0)
+ local session_name="ust_app_snapshot_base_path"
local base_path="my/custom/path3"
diag "Test base path override for remote trace snapshot (URI on snapshot)"
destroy_lttng_session_ok $session_name
# validate test
- validate_trace $EVENT_NAME $TRACE_PATH/$HOSTNAME/$base_path
- if [ $? -eq 0 ]; then
+ if validate_trace $EVENT_NAME "$TRACE_PATH/$HOSTNAME/$base_path"; then
# only delete if successful
- rm -rf $TRACE_PATH
+ rm -rf "$TRACE_PATH"
fi
}
function ust_app_snapshot_add_output_base_path ()
{
- local session_name=$(randstring 16 0)
+ local session_name="ust_app_snapshot_add_output_base_path"
local base_path="my/custom/path4"
diag "Test base path override for remote trace snapshot (URI on add-output)"
destroy_lttng_session_ok $session_name
# validate test
- validate_trace $EVENT_NAME $TRACE_PATH/$HOSTNAME/$base_path
- if [ $? -eq 0 ]; then
+ if validate_trace $EVENT_NAME "$TRACE_PATH/$HOSTNAME/$base_path"; then
# only delete if successful
- rm -rf $TRACE_PATH
+ rm -rf "$TRACE_PATH"
fi
}
ust_app_snapshot_add_output_base_path
ust_app_stream_base_path_via_load
)
-for fct_test in ${tests[@]};
+for fct_test in "${tests[@]}";
do
${fct_test}
done