From 1d20c959e3aa1a9a205fd7fff2d912b6bada1d23 Mon Sep 17 00:00:00 2001 From: David Goulet Date: Mon, 25 Nov 2013 14:55:57 -0500 Subject: [PATCH] Fix: create a fast and a long UST snapshot test The fast one does 10 snapshots where the long one keeps the 1000 original value. The make check only executes the fast one. Signed-off-by: David Goulet --- tests/fast_regression | 2 +- tests/long_regression | 1 + tests/regression/tools/snapshots/Makefile.am | 4 +-- .../regression/tools/snapshots/test_ust_fast | 29 ++++++++++++++++++ .../regression/tools/snapshots/test_ust_long | 29 ++++++++++++++++++ .../tools/snapshots/{test_ust => ust_test} | 30 +++++++++---------- 6 files changed, 77 insertions(+), 18 deletions(-) create mode 100755 tests/regression/tools/snapshots/test_ust_fast create mode 100755 tests/regression/tools/snapshots/test_ust_long rename tests/regression/tools/snapshots/{test_ust => ust_test} (96%) diff --git a/tests/fast_regression b/tests/fast_regression index 64b089225..54707229d 100644 --- a/tests/fast_regression +++ b/tests/fast_regression @@ -8,7 +8,7 @@ regression/tools/live/test_lttng_ust regression/tools/tracefile-limits/test_tracefile_count regression/tools/tracefile-limits/test_tracefile_size regression/tools/exclusion/test_exclusion -regression/tools/snapshots/test_ust +regression/tools/snapshots/test_ust_fast regression/tools/snapshots/test_ust_streaming regression/ust/before-after/test_before_after regression/ust/buffers-pid/test_buffers_pid diff --git a/tests/long_regression b/tests/long_regression index 2c6afcdc1..ab4339ddf 100644 --- a/tests/long_regression +++ b/tests/long_regression @@ -5,6 +5,7 @@ regression/tools/health/test_thread_exit regression/tools/health/test_thread_stall regression/tools/health/test_tp_fail 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/ust/before-after/test_before_after diff --git a/tests/regression/tools/snapshots/Makefile.am b/tests/regression/tools/snapshots/Makefile.am index 66e9ddd31..39cda7821 100644 --- a/tests/regression/tools/snapshots/Makefile.am +++ b/tests/regression/tools/snapshots/Makefile.am @@ -1,5 +1,5 @@ -noinst_SCRIPTS = test_kernel test_kernel_streaming test_ust test_ust_streaming -EXTRA_DIST = test_kernel test_kernel_streaming test_ust test_ust_streaming +noinst_SCRIPTS = test_kernel test_kernel_streaming test_ust_fast test_ust_long ust_test test_ust_streaming +EXTRA_DIST = test_kernel test_kernel_streaming test_ust_fast test_ust_long ust_test test_ust_streaming all-local: @if [ x"$(srcdir)" != x"$(builddir)" ]; then \ diff --git a/tests/regression/tools/snapshots/test_ust_fast b/tests/regression/tools/snapshots/test_ust_fast new file mode 100755 index 000000000..edb435c52 --- /dev/null +++ b/tests/regression/tools/snapshots/test_ust_fast @@ -0,0 +1,29 @@ +#!/bin/bash +# +# Copyright (C) - 2013 Julien Desfossez +# +# This library is free software; you can redistribute it and/or modify it under +# the terms of the GNU Lesser General Public License as published by the Free +# Software Foundation; version 2.1 of the License. +# +# This library 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 Lesser General Public License for more +# details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this library; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +CURDIR=$(dirname $0)/ +NR_SNAPSHOT=10 +TESTDIR=$CURDIR/../../.. +TEST_BIN="ust_test" + +source $TESTDIR/utils/utils.sh + +if [ ! -x "$CURDIR/$TEST_BIN" ]; then + BAIL_OUT "No UST test found: $TEST_BIN" +fi + +./$CURDIR/$TEST_BIN $NR_SNAPSHOT diff --git a/tests/regression/tools/snapshots/test_ust_long b/tests/regression/tools/snapshots/test_ust_long new file mode 100755 index 000000000..9e1a0c262 --- /dev/null +++ b/tests/regression/tools/snapshots/test_ust_long @@ -0,0 +1,29 @@ +#!/bin/bash +# +# Copyright (C) - 2013 Julien Desfossez +# +# This library is free software; you can redistribute it and/or modify it under +# the terms of the GNU Lesser General Public License as published by the Free +# Software Foundation; version 2.1 of the License. +# +# This library 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 Lesser General Public License for more +# details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this library; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +CURDIR=$(dirname $0)/ +NR_SNAPSHOT=1000 +TESTDIR=$CURDIR/../../.. +TEST_BIN="ust_test" + +source $TESTDIR/utils/utils.sh + +if [ ! -x "$CURDIR/$TEST_BIN" ]; then + BAIL_OUT "No UST test found: $TEST_BIN" +fi + +./$CURDIR/$TEST_BIN $NR_SNAPSHOT diff --git a/tests/regression/tools/snapshots/test_ust b/tests/regression/tools/snapshots/ust_test similarity index 96% rename from tests/regression/tools/snapshots/test_ust rename to tests/regression/tools/snapshots/ust_test index bdc6f74d6..e727aa634 100755 --- a/tests/regression/tools/snapshots/test_ust +++ b/tests/regression/tools/snapshots/ust_test @@ -28,9 +28,9 @@ TESTAPP_BIN="$TESTAPP_PATH/$TESTAPP_NAME/$TESTAPP_NAME" NR_ITER=2000000 NR_USEC_WAIT=100 -TRACE_PATH=$(mktemp -d) +NUM_TESTS=76 -NUM_TESTS=2076 +TRACE_PATH=$(mktemp -d) source $TESTDIR/utils/utils.sh @@ -38,6 +38,14 @@ if [ ! -x "$TESTAPP_BIN" ]; then BAIL_OUT "No UST events binary detected." fi +# Need the number of snapshot to do. +if [ -z $1 ]; then + BAIL_OUT "A number of snapshot is needed." +fi +NR_SNAPSHOT=$1 + +NUM_TESTS=$(($NUM_TESTS + ($NR_SNAPSHOT * 2))) + function start_test_app() { local tmp_file="/tmp/lttng_test_ust.42.file" @@ -308,11 +316,9 @@ function test_ust_per_uid_local_snapshot_post_mortem () fi } -function test_ust_1000_local_snapshots () +function test_ust_local_snapshots () { - NB_SNAP=1000 - - diag "Test $NB_SNAP local UST snapshots" + diag "Test $NR_SNAPSHOT local UST snapshots" create_lttng_session_no_output $SESSION_NAME enable_lttng_mmap_overwrite_ust_channel $SESSION_NAME $CHANNEL_NAME enable_ust_lttng_event $SESSION_NAME $EVENT_NAME $CHANNEL_NAME @@ -322,8 +328,8 @@ function test_ust_1000_local_snapshots () # Returns once the application has at least fired ONE tracepoint. start_test_app - for i in $(seq 1 $NB_SNAP); do - diag "Snapshot $i/$NB_SNAP" + for i in $(seq 1 $NR_SNAPSHOT); do + diag "Snapshot $i/$NR_SNAPSHOT" rm -rf $TRACE_PATH/snapshot/* 2>/dev/null lttng_snapshot_record $SESSION_NAME # Validate test @@ -345,12 +351,6 @@ plan_tests $NUM_TESTS print_test_banner "$TEST_DESC" -if [ "$(id -u)" == "0" ]; then - isroot=1 -else - isroot=0 -fi - start_lttng_sessiond tests=( test_ust_list_output @@ -359,7 +359,7 @@ tests=( test_ust_list_output test_ust_per_uid_local_snapshot test_ust_per_uid_local_snapshot_post_mortem test_ust_local_snapshot_large_metadata - test_ust_1000_local_snapshots ) + test_ust_local_snapshots) for fct_test in ${tests[@]}; do -- 2.34.1