TRACE_PATH=$(mktemp -d)
-source $TESTDIR/utils/utils.sh
+NUM_TESTS=18
-print_test_banner "$TEST_DESC"
+source $TESTDIR/utils/utils.sh
if [ ! -x "$CURDIR/$BIN_NAME" ]; then
- echo -e "No UST nevents binary detected. Passing."
- exit 0
+ BAIL_OUT "No UST nevents binary detected."
fi
function lttng_create_session_uri
{
# Create session with default path
$TESTDIR/../src/bin/lttng/$LTTNG_BIN create $SESSION_NAME -U net://localhost >/dev/null 2>&1
+ ok $? "Create session with default path"
}
function wait_apps
{
- echo -n "Waiting for applications to end"
while [ -n "$(pidof $BIN_NAME)" ]; do
- echo -n "."
sleep 0.5
done
- echo ""
+ pass "Wait for applications to end"
}
# MUST set TESTDIR before calling those functions
function test_ust_before_start ()
{
- echo -e "\n=== Testing UST streaming BEFORE tracing starts\n"
+ diag "Test UST streaming BEFORE tracing starts"
lttng_create_session_uri
enable_ust_lttng_event $SESSION_NAME $EVENT_NAME
start_lttng_tracing $SESSION_NAME
wait_apps
+
stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
}
function test_ust_after_start ()
{
- echo -e "\n=== Testing UST streaming AFTER tracing starts\n"
+ diag "Test UST streaming AFTER tracing starts"
lttng_create_session_uri
enable_ust_lttng_event $SESSION_NAME $EVENT_NAME
start_lttng_tracing $SESSION_NAME
./$CURDIR/$BIN_NAME 5 1000000 >/dev/null 2>&1 &
wait_apps
+
stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
}
-start_lttng_sessiond
+plan_tests $NUM_TESTS
+
+print_test_banner "$TEST_DESC"
+
start_lttng_relayd "-o $TRACE_PATH"
+start_lttng_sessiond
tests=( test_ust_before_start test_ust_after_start )
fi
done
-echo ""
stop_lttng_sessiond
stop_lttng_relayd