summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
eb82f91)
This is linked to #831 where the JUL disable event test was NOT failing
but was using a bogus trace match function. It should have match a
specific number of event only.
This commit makes the test java JUL fail.
Signed-off-by: David Goulet <dgoulet@efficios.com>
-trace_matches $EVENT_NAME $NR_ITER $TRACE_PATH
+trace_match_only $EVENT_NAME $NR_ITER $TRACE_PATH
rm -rf $TRACE_PATH
stop_lttng_relayd
rm -rf $TRACE_PATH
stop_lttng_relayd
stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
- trace_matches $EVENT_NAME $NR_ITER $TRACE_PATH
+ trace_match_only $EVENT_NAME $NR_ITER $TRACE_PATH
stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
- trace_matches $EVENT_NAME $[NR_ITER * 5] $TRACE_PATH
+ trace_match_only $EVENT_NAME $[NR_ITER * 5] $TRACE_PATH
stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
- trace_matches $EVENT_NAME $NR_ITER $TRACE_PATH
+ trace_match_only $EVENT_NAME $NR_ITER $TRACE_PATH
ok $? "Start application to trace"
stop_lttng_tracing $SESSION_NAME
ok $? "Start application to trace"
stop_lttng_tracing $SESSION_NAME
- trace_matches $EVENT_NAME $[NR_ITER * 5] $TRACE_PATH
+ trace_match_only $EVENT_NAME $[NR_ITER * 5] $TRACE_PATH
out=$?
destroy_lttng_session $SESSION_NAME
out=$?
destroy_lttng_session $SESSION_NAME
destroy_lttng_session $SESSION_NAME
# Validate test. Expecting all events.
destroy_lttng_session $SESSION_NAME
# Validate test. Expecting all events.
- trace_matches $EVENT_NAME $NR_ITER $TRACE_PATH
+ trace_match_only $EVENT_NAME $NR_ITER $TRACE_PATH
if [ $? -ne 0 ]; then
return $?
fi
if [ $? -ne 0 ]; then
return $?
fi
destroy_lttng_session $SESSION_NAME
# Validate test. Expecting all events.
destroy_lttng_session $SESSION_NAME
# Validate test. Expecting all events.
- trace_matches $EVENT_NAME $NR_ITER $TRACE_PATH
+ trace_match_only $EVENT_NAME $NR_ITER $TRACE_PATH
if [ $? -ne 0 ]; then
return $?
fi
if [ $? -ne 0 ]; then
return $?
fi
destroy_lttng_session $SESSION_NAME
# Validate test. Expecting all events.
destroy_lttng_session $SESSION_NAME
# Validate test. Expecting all events.
- trace_matches $EVENT_NAME $NR_ITER $TRACE_PATH
+ trace_match_only $EVENT_NAME $NR_ITER $TRACE_PATH
if [ $? -ne 0 ]; then
return $?
fi
if [ $? -ne 0 ]; then
return $?
fi
destroy_lttng_session $SESSION_NAME
# Validate test. Expecting 0 events.
destroy_lttng_session $SESSION_NAME
# Validate test. Expecting 0 events.
- trace_matches $EVENT_NAME 0 $TRACE_PATH
+ trace_match_only $EVENT_NAME 0 $TRACE_PATH
if [ $? -ne 0 ]; then
return $?
fi
if [ $? -ne 0 ]; then
return $?
fi
destroy_lttng_session $SESSION_NAME
# Validate test. Expecting all events.
destroy_lttng_session $SESSION_NAME
# Validate test. Expecting all events.
- trace_matches $EVENT_NAME $NR_ITER $TRACE_PATH
+ trace_match_only $EVENT_NAME $NR_ITER $TRACE_PATH
destroy_lttng_session $SESSION_NAME
# Validate test. Expecting all events times two.
destroy_lttng_session $SESSION_NAME
# Validate test. Expecting all events times two.
- trace_matches $EVENT_NAME $(($NR_ITER * 2)) $TRACE_PATH
+ trace_match_only $EVENT_NAME $(($NR_ITER * 2)) $TRACE_PATH
if [ $? -ne 0 ]; then
return $?
fi
if [ $? -ne 0 ]; then
return $?
fi
destroy_lttng_session $SESSION_NAME
# Validate test. Expecting all events times two.
destroy_lttng_session $SESSION_NAME
# Validate test. Expecting all events times two.
- trace_matches $EVENT_NAME $(($NR_ITER * 2)) $TRACE_PATH
+ trace_match_only $EVENT_NAME $(($NR_ITER * 2)) $TRACE_PATH
if [ $? -ne 0 ]; then
return $?
fi
if [ $? -ne 0 ]; then
return $?
fi
destroy_lttng_session $SESSION_NAME-2
# Expecting 6 events being the main event plus the second tp.
destroy_lttng_session $SESSION_NAME-2
# Expecting 6 events being the main event plus the second tp.
- trace_matches $EVENT_NAME $(($NR_ITER + 1)) $TRACE_PATH/$SESSION_NAME-1
+ trace_match_only $EVENT_NAME $(($NR_ITER + 1)) $TRACE_PATH/$SESSION_NAME-1
if [ $? -ne 0 ]; then
return $?
fi
# Expectin 5 events being the finest TP.
if [ $? -ne 0 ]; then
return $?
fi
# Expectin 5 events being the finest TP.
- trace_matches $EVENT_NAME $NR_ITER $TRACE_PATH/$SESSION_NAME-2
+ trace_match_only $EVENT_NAME $NR_ITER $TRACE_PATH/$SESSION_NAME-2
if [ $? -ne 0 ]; then
return $?
fi
if [ $? -ne 0 ]; then
return $?
fi
destroy_lttng_session $SESSION_NAME-2
# Validate test. Expecting one event of the second TP.
destroy_lttng_session $SESSION_NAME-2
# Validate test. Expecting one event of the second TP.
- trace_matches $EVENT_NAME2 1 $TRACE_PATH/$SESSION_NAME-1
+ trace_match_only $EVENT_NAME2 1 $TRACE_PATH/$SESSION_NAME-1
if [ $? -ne 0 ]; then
return $?
fi
# Validate test. Expecting one event of the second TP.
if [ $? -ne 0 ]; then
return $?
fi
# Validate test. Expecting one event of the second TP.
- trace_matches $EVENT_NAME2 1 $TRACE_PATH/$SESSION_NAME-2
+ trace_match_only $EVENT_NAME2 1 $TRACE_PATH/$SESSION_NAME-2
if [ $? -ne 0 ]; then
return $?
fi
if [ $? -ne 0 ]; then
return $?
fi
destroy_lttng_session $SESSION_NAME-2
# Validate test. Expecting all events of first TP
destroy_lttng_session $SESSION_NAME-2
# Validate test. Expecting all events of first TP
- trace_matches $EVENT_NAME $NR_ITER $TRACE_PATH/$SESSION_NAME-1
+ trace_match_only $EVENT_NAME $NR_ITER $TRACE_PATH/$SESSION_NAME-1
if [ $? -ne 0 ]; then
return $?
fi
# Validate test. Expecting one event of the second TP.
if [ $? -ne 0 ]; then
return $?
fi
# Validate test. Expecting one event of the second TP.
- trace_matches $EVENT_NAME2 1 $TRACE_PATH/$SESSION_NAME-2
+ trace_match_only $EVENT_NAME2 1 $TRACE_PATH/$SESSION_NAME-2
if [ $? -ne 0 ]; then
return $?
fi
if [ $? -ne 0 ]; then
return $?
fi
destroy_lttng_session $SESSION_NAME
# Validate test. Expecting only one event num 2
destroy_lttng_session $SESSION_NAME
# Validate test. Expecting only one event num 2
- trace_matches $EVENT_NAME2 1 $TRACE_PATH/second-sess
+ trace_match_only $EVENT_NAME2 1 $TRACE_PATH/second-sess
if [ $? -ne 0 ]; then
return $?
fi
if [ $? -ne 0 ]; then
return $?
fi
destroy_lttng_session $SESSION_NAME
# Validate test. Expecting one event of the second TP only.
destroy_lttng_session $SESSION_NAME
# Validate test. Expecting one event of the second TP only.
- trace_matches $EVENT_NAME2 1 $TRACE_PATH/$SESSION_NAME
+ trace_match_only $EVENT_NAME2 1 $TRACE_PATH/$SESSION_NAME
if [ $? -ne 0 ]; then
return $?
fi
if [ $? -ne 0 ]; then
return $?
fi
destroy_lttng_session $SESSION_NAME
# Validate test. Expecting NR_ITER event of the main INFO tp.
destroy_lttng_session $SESSION_NAME
# Validate test. Expecting NR_ITER event of the main INFO tp.
- trace_matches $EVENT_NAME $NR_ITER $TRACE_PATH/$SESSION_NAME
+ trace_match_only $EVENT_NAME $NR_ITER $TRACE_PATH/$SESSION_NAME
if [ $? -ne 0 ]; then
return $?
fi
if [ $? -ne 0 ]; then
return $?
fi
destroy_lttng_session $SESSION_NAME
# Validate test. Expecting one event of the second TP only.
destroy_lttng_session $SESSION_NAME
# Validate test. Expecting one event of the second TP only.
- trace_matches $EVENT_NAME2 1 $TRACE_PATH/$SESSION_NAME
+ trace_match_only $EVENT_NAME2 1 $TRACE_PATH/$SESSION_NAME
if [ $? -ne 0 ]; then
return $?
fi
if [ $? -ne 0 ]; then
return $?
fi
destroy_lttng_session $SESSION_NAME
# Validate test. Expecting NR_ITER event of the main INFO tp.
destroy_lttng_session $SESSION_NAME
# Validate test. Expecting NR_ITER event of the main INFO tp.
- trace_matches $EVENT_NAME $NR_ITER $TRACE_PATH/$SESSION_NAME
+ trace_match_only $EVENT_NAME $NR_ITER $TRACE_PATH/$SESSION_NAME
if [ $? -ne 0 ]; then
return $?
fi
if [ $? -ne 0 ]; then
return $?
fi
stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
- trace_matches $EVENT_NAME $NR_ITER $TRACE_PATH
+ trace_match_only $EVENT_NAME $NR_ITER $TRACE_PATH
+function trace_match_only()
+{
+ local event_name=$1
+ local nr_iter=$2
+ local trace_path=$3
+
+ which $BABELTRACE_BIN >/dev/null
+ skip $? -ne 0 "Babeltrace binary not found. Skipping trace matches"
+
+ local count=$($BABELTRACE_BIN $trace_path | grep $event_name | wc -l)
+ local total=$($BABELTRACE_BIN $trace_path | wc -l)
+
+ if [ "$nr_iter" -eq "$count" ] && [ "$total" -eq "$nr_iter" ]; then
+ pass "Trace match with $total event $event_name"
+ else
+ fail "Trace match"
+ diag "$total event(s) found, expecting $nr_iter of event $event_name and only found $count"
+ fi
+}
+
function validate_trace
{
local event_name=$1
function validate_trace
{
local event_name=$1