Implement test_event_tracef
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 27 May 2014 20:25:26 +0000 (16:25 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Tue, 27 May 2014 20:31:52 +0000 (16:31 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
tests/fast_regression
tests/long_regression
tests/regression/ust/Makefile.am
tests/regression/ust/test_event_tracef [new file with mode: 0755]

index 6ab26078c9e97922d9e350455b00d043433cbdee..a3c2fe9947e99dcf26800b021d5f6aad530bb69e 100644 (file)
@@ -20,5 +20,6 @@ regression/ust/nprocesses/test_nprocesses
 regression/ust/overlap/test_overlap
 regression/ust/java-jul/test_java_jul
 regression/ust/test_event_basic
+regression/ust/test_event_tracef
 regression/ust/test_event_wildcard
 regression/ust/test_event_perf
index ab4339ddfa8e2bc5e4733efbaec3b181885cc00e..1fa8514f1e9ccbfd1cdc0aeb206586c9bf4faba1 100644 (file)
@@ -16,4 +16,5 @@ regression/ust/multi-session/test_multi_session
 regression/ust/nprocesses/test_nprocesses
 regression/ust/overlap/test_overlap
 regression/ust/test_event_basic
+regression/ust/test_event_tracef
 regression/ust/test_event_wildcard
index a4e3455aec145744f1301732be1135fb9fcd082d..a95a605a735ebdf82f2554d39933517bf8521851 100644 (file)
@@ -3,7 +3,7 @@ SUBDIRS = nprocesses high-throughput low-throughput before-after multi-session \
                overlap buffers-pid linking daemon exit-fast fork libc-wrapper \
                periodical-metadata-flush java-jul
 
-EXTRA_DIST = test_event_basic test_event_wildcard
+EXTRA_DIST = test_event_basic test_event_wildcard test_event_tracef
 
 all-local:
        @if [ x"$(srcdir)" != x"$(builddir)" ]; then \
diff --git a/tests/regression/ust/test_event_tracef b/tests/regression/ust/test_event_tracef
new file mode 100755 (executable)
index 0000000..66528d1
--- /dev/null
@@ -0,0 +1,72 @@
+#!/bin/bash
+#
+# Copyright (C) - 2013 Christian Babeux <christian.babeux@efficios.com>
+# Copyright (C) - 2014 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License, version 2 only, as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 51
+# Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+TEST_DESC="UST tracer - tracef events"
+
+CURDIR=$(dirname $0)/
+TESTDIR=$CURDIR/../..
+LTTNG_BIN="lttng"
+TESTAPP_PATH="$TESTDIR/utils/testapp"
+TESTAPP_NAME="gen-ust-tracef"
+TESTAPP_BIN="$TESTAPP_PATH/$TESTAPP_NAME/$TESTAPP_NAME"
+SESSION_NAME="tracef"
+EVENT_NAME="lttng_ust_tracef:event"
+NUM_TESTS=9
+NR_ITER=100
+
+source $TESTDIR/utils/utils.sh
+
+if [ ! -x "$TESTAPP_BIN" ]; then
+       BAIL_OUT "No UST nevents binary detected."
+fi
+
+function test_event_tracef()
+{
+       create_lttng_session $SESSION_NAME $TRACE_PATH
+       enable_ust_lttng_event $SESSION_NAME $EVENT_NAME
+       start_lttng_tracing $SESSION_NAME
+
+       $TESTAPP_BIN $NR_ITER $NR_USEC_WAIT
+       ok $? "Traced application stopped."
+
+       stop_lttng_tracing $SESSION_NAME
+       destroy_lttng_session $SESSION_NAME
+
+       trace_matches $EVENT_NAME $NR_ITER $TRACE_PATH
+
+       return $?
+}
+
+# MUST set TESTDIR before calling those functions
+plan_tests $NUM_TESTS
+
+print_test_banner "$TEST_DESC"
+
+start_lttng_sessiond
+
+TRACE_PATH=$(mktemp -d)
+test_event_tracef
+out=$?
+if [ $out -ne 0 ]; then
+       stop_lttng_sessiond
+       exit $out
+fi
+
+stop_lttng_sessiond
+
+rm -rf $TRACE_PATH
This page took 0.035268 seconds and 4 git commands to generate.