Tests: expand UST wildcard tests, move to regression/tools
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 4 Sep 2015 23:53:18 +0000 (19:53 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sun, 6 Sep 2015 03:07:11 +0000 (23:07 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
configure.ac
tests/fast_regression
tests/long_regression
tests/regression/tools/Makefile.am
tests/regression/tools/wildcard/Makefile.am [new file with mode: 0644]
tests/regression/tools/wildcard/test_event_wildcard [new file with mode: 0755]
tests/regression/ust/Makefile.am
tests/regression/ust/test_event_wildcard [deleted file]

index 1cc82c495cb7fb09cf471e68329d7febc8f3f8a7..06332d32c548e453d98430105aca734af7b104d5 100644 (file)
@@ -616,6 +616,7 @@ AC_CONFIG_FILES([
        tests/regression/tools/exclusion/Makefile
        tests/regression/tools/save-load/Makefile
        tests/regression/tools/mi/Makefile
+       tests/regression/tools/wildcard/Makefile
        tests/regression/ust/Makefile
        tests/regression/ust/nprocesses/Makefile
        tests/regression/ust/high-throughput/Makefile
index fa88621a54a85c787e2440e78bea7c93a8fba0ff..420fffbbbc7b574e390f3165420464020b51c5a7 100644 (file)
@@ -14,6 +14,7 @@ regression/tools/snapshots/test_ust_streaming
 regression/tools/save-load/test_save
 regression/tools/save-load/test_load
 regression/tools/mi/test_mi
+regression/tools/wildcard/test_event_wildcard
 regression/ust/before-after/test_before_after
 regression/ust/buffers-pid/test_buffers_pid
 regression/ust/multi-session/test_multi_session
@@ -26,5 +27,4 @@ regression/ust/getcpu-override/test_getcpu_override
 regression/ust/clock-override/test_clock_override
 regression/ust/test_event_basic
 regression/ust/test_event_tracef
-regression/ust/test_event_wildcard
 regression/ust/test_event_perf
index 1fa8514f1e9ccbfd1cdc0aeb206586c9bf4faba1..105dc510b567deb898caa90dec979bfc89420362 100644 (file)
@@ -8,6 +8,7 @@ regression/tools/streaming/test_ust
 regression/tools/snapshots/test_ust_long
 regression/tools/tracefile-limits/test_tracefile_count
 regression/tools/tracefile-limits/test_tracefile_size
+regression/tools/wildcard/test_event_wildcard
 regression/ust/before-after/test_before_after
 regression/ust/buffers-pid/test_buffers_pid
 regression/ust/high-throughput/test_high_throughput
@@ -17,4 +18,3 @@ 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 09f55b33ac81f5d1d085a04f17697a18c83ad8ee..a798de3327b30299b2d8334329d70ff0ee6d3f48 100644 (file)
@@ -1 +1,2 @@
-SUBDIRS = streaming filtering health tracefile-limits snapshots live exclusion save-load mi
+SUBDIRS = streaming filtering health tracefile-limits snapshots live exclusion save-load mi \
+               wildcard
diff --git a/tests/regression/tools/wildcard/Makefile.am b/tests/regression/tools/wildcard/Makefile.am
new file mode 100644 (file)
index 0000000..b95b495
--- /dev/null
@@ -0,0 +1,26 @@
+AM_CFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src -I$(top_srcdir)/tests -I$(srcdir) -O2 -g
+AM_LDFLAGS =
+
+if LTTNG_TOOLS_BUILD_WITH_LIBDL
+LIBS += -ldl
+endif
+if LTTNG_TOOLS_BUILD_WITH_LIBC_DL
+LIBS += -lc
+endif
+
+noinst_SCRIPTS = test_event_wildcard
+EXTRA_DIST = test_event_wildcard
+
+all-local:
+       @if [ x"$(srcdir)" != x"$(builddir)" ]; then \
+               for script in $(EXTRA_DIST); do \
+                       cp -f $(srcdir)/$$script $(builddir); \
+               done; \
+       fi
+
+clean-local:
+       @if [ x"$(srcdir)" != x"$(builddir)" ]; then \
+               for script in $(EXTRA_DIST); do \
+                       rm -f $(builddir)/$$script; \
+               done; \
+       fi
diff --git a/tests/regression/tools/wildcard/test_event_wildcard b/tests/regression/tools/wildcard/test_event_wildcard
new file mode 100755 (executable)
index 0000000..7fbfc18
--- /dev/null
@@ -0,0 +1,93 @@
+#!/bin/bash
+#
+# Copyright (C) - 2013 Christian Babeux <christian.babeux@efficios.com>
+# Copyright (C) - 2015 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 - Event wildcard"
+
+CURDIR=$(dirname $0)/
+TESTDIR=$CURDIR/../..
+LTTNG_BIN="lttng"
+TESTAPP_PATH="$TESTDIR/utils/testapp"
+TESTAPP_NAME="gen-ust-events"
+TESTAPP_BIN="$TESTAPP_PATH/$TESTAPP_NAME/$TESTAPP_NAME"
+SESSION_NAME="wildcard"
+EVENT_NAME="tp:tptest"
+NUM_TESTS=39
+NR_ITER=100
+
+source $TESTDIR/utils/utils.sh
+
+if [ ! -x "$TESTAPP_BIN" ]; then
+       BAIL_OUT "No UST nevents binary detected."
+fi
+
+function test_event_wildcard()
+{
+       TRACE_PATH=$(mktemp -d)
+       FIND="${1}"
+       WILDCARD="${2}"
+
+       create_lttng_session_ok $SESSION_NAME $TRACE_PATH
+       enable_ust_lttng_event_ok $SESSION_NAME "$WILDCARD"
+
+       start_lttng_tracing_ok
+
+       $TESTAPP_BIN $NR_ITER $NR_USEC_WAIT
+       ok $? "Traced application stopped."
+
+       stop_lttng_tracing_ok
+       destroy_lttng_session_ok $SESSION_NAME
+
+       if [ ${FIND} -eq 1 ]; then
+               trace_matches $EVENT_NAME $NR_ITER $TRACE_PATH
+       else
+               validate_trace_empty $TRACE_PATH
+       fi
+
+       rm -rf $TRACE_PATH
+}
+
+function test_event_wildcard_fail()
+{
+       TRACE_PATH=$(mktemp -d)
+       WILDCARD="${1}"
+
+       create_lttng_session_ok $SESSION_NAME $TRACE_PATH
+       enable_ust_lttng_event_fail $SESSION_NAME "$WILDCARD"
+       destroy_lttng_session_ok $SESSION_NAME
+
+       rm -rf $TRACE_PATH
+}
+
+
+# MUST set TESTDIR before calling those functions
+plan_tests $NUM_TESTS
+
+print_test_banner "$TEST_DESC"
+
+start_lttng_sessiond
+
+test_event_wildcard 1 'tp:tp*'
+test_event_wildcard 1 '*'
+test_event_wildcard 1 'tp:tptest*'
+test_event_wildcard 0 'tp:abc*'
+
+test_event_wildcard_fail 'tp:*tp'
+test_event_wildcard_fail 'tp:tp**'
+test_event_wildcard_fail '*tp:tp*'
+
+stop_lttng_sessiond
index 2616dc77b8b0cc416d217269c584f73fa4157682..f2afad5eafbdb24ddd02f38b66432b87469e5e28 100644 (file)
@@ -4,7 +4,7 @@ SUBDIRS = nprocesses high-throughput low-throughput before-after multi-session \
                periodical-metadata-flush java-jul java-log4j python-logging \
                getcpu-override clock-override
 
-EXTRA_DIST = test_event_basic test_event_wildcard test_event_tracef test_event_perf
+EXTRA_DIST = test_event_basic test_event_tracef test_event_perf
 
 all-local:
        @if [ x"$(srcdir)" != x"$(builddir)" ]; then \
diff --git a/tests/regression/ust/test_event_wildcard b/tests/regression/ust/test_event_wildcard
deleted file mode 100755 (executable)
index 1c0b27a..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-#!/bin/bash
-#
-# Copyright (C) - 2013 Christian Babeux <christian.babeux@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 - Event wildcard"
-
-CURDIR=$(dirname $0)/
-TESTDIR=$CURDIR/../..
-LTTNG_BIN="lttng"
-BIN_NAME="gen-ust-events"
-SESSION_NAME="valid_filter"
-EVENT_NAME="tp:tptest"
-NUM_TESTS=9
-
-source $TESTDIR/utils/utils.sh
-
-function test_event_wildcard()
-{
-       TRACE_PATH=$(mktemp -d)
-       SESSION_NAME="ust_event_basic"
-       SESSION_NAME2="ust_event_basic2"
-       CHAN_NAME="mychan"
-       CHAN_NAME2="mychan2"
-       EVENT_NAME="*"
-       EVENT_NAME2="abc*"
-
-       create_lttng_session_ok $SESSION_NAME $TRACE_PATH
-
-       enable_ust_lttng_event_ok $SESSION_NAME "$EVENT_NAME"
-       enable_ust_lttng_event_ok $SESSION_NAME "$EVENT_NAME2"
-
-       start_lttng_tracing_ok
-       stop_lttng_tracing_ok
-
-       TODO="Validate trace output is coherent"
-       ok 0 "Validate trace"
-       unset TODO
-
-       destroy_lttng_session_ok $SESSION_NAME
-
-       rm -rf $TRACE_PATH
-}
-
-# MUST set TESTDIR before calling those functions
-plan_tests $NUM_TESTS
-
-print_test_banner "$TEST_DESC"
-
-start_lttng_sessiond
-
-test_event_wildcard
-
-stop_lttng_sessiond
This page took 0.029301 seconds and 4 git commands to generate.