local finest_tp=$1
local fire_second_tp=$2
- java -cp $JAVA_CP -Djava.library.path="/usr/local/lib:/usr/lib" $TESTAPP_NAME $NR_ITER $NR_MSEC_WAIT $finest_tp $fire_second_tp >/dev/null 2>&1 &
+ #FIXME: app should have synchro.
+ java -cp $JAVA_CP -Djava.library.path="/usr/local/lib:/usr/lib" $TESTAPP_NAME $NR_ITER $NR_MSEC_WAIT $finest_tp $fire_second_tp >/dev/null 2>&1
}
function wait_apps
function test_jul_before_start ()
{
+ local file_sync_after_first=$(mktemp -u)
+ local file_sync_before_last=$(mktemp -u)
+
diag "Test JUL application BEFORE tracing starts"
create_lttng_session $SESSION_NAME $TRACE_PATH
enable_jul_lttng_event $SESSION_NAME $EVENT_NAME
start_lttng_tracing $SESSION_NAME
- wait_apps
+ touch ${file_sync_before_last}
+
+ # Wait for the applications started in background
+ wait
stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
+ rm -f ${file_sync_after_first}
+ rm -f ${file_sync_before_last}
+
# Validate test. Expecting all events.
trace_matches $EVENT_NAME $NR_ITER $TRACE_PATH
if [ $? -ne 0 ]; then
# Run 5 times with a 1 second delay
run_app 0 1
- sleep 1
+ # Wait for the applications started in background
+ wait
stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
enable_jul_lttng_event $SESSION_NAME $EVENT_NAME2
start_lttng_tracing $SESSION_NAME
- wait_apps
+ # Run 5 times with a 1 second delay
+ run_app_background 0 1
+
+ # Wait for the applications started in background
+ wait
stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
fi
}
+function test_jul_disable()
+{
+ diag "Test JUL disable event"
+
+ create_lttng_session $SESSION_NAME $TRACE_PATH/$SESSION_NAME
+ # Enable all event with a filter.
+ enable_jul_lttng_event $SESSION_NAME $EVENT_NAME
+ enable_jul_lttng_event $SESSION_NAME $EVENT_NAME2
+ disable_jul_lttng_event $SESSION_NAME $EVENT_NAME
+ start_lttng_tracing $SESSION_NAME
+
+ # Fire second TP but not the finest one.
+ run_app 0 1
+ wait_apps
+
+ stop_lttng_tracing $SESSION_NAME
+ destroy_lttng_session $SESSION_NAME
+
+ # Validate test. Expecting one event of the second TP only.
+ trace_match_only $EVENT_NAME2 1 $TRACE_PATH/$SESSION_NAME
+ if [ $? -ne 0 ]; then
+ return $?
+ fi
+}
+
plan_tests $NUM_TESTS
print_test_banner "$TEST_DESC"
start_lttng_sessiond
tests=(
+ test_jul_disable
test_jul_multi_session_loglevel
test_jul_destroy_session
test_jul_loglevel
if [ $? -ne 0 ]; then
break;
fi
- rm -rf $TRACE_PATH
+ #rm -rf $TRACE_PATH
done
stop_lttng_sessiond