X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=tests%2Fregression%2Fust%2Fmulti-session%2Ftest_multi_session;h=91f064daea1500df297172fdfbd7323f9ffaf9c4;hb=741ecffbe095ebf26b5c217896786f7f52ff2b15;hp=45da8d20497522fe4c97ed79b44cfb4f54c4433e;hpb=96340a015194538227efcbc654ec02c2ed9961ce;p=lttng-tools.git diff --git a/tests/regression/ust/multi-session/test_multi_session b/tests/regression/ust/multi-session/test_multi_session index 45da8d204..91f064dae 100755 --- a/tests/regression/ust/multi-session/test_multi_session +++ b/tests/regression/ust/multi-session/test_multi_session @@ -1,28 +1,19 @@ #!/bin/bash # -# Copyright (C) - 2012 David Goulet +# Copyright (C) 2012 David Goulet # -# 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 +# SPDX-License-Identifier: LGPL-2.1-only + TEST_DESC="UST tracer - Multi-session" -CURDIR=$(dirname $0)/ +CURDIR=$(dirname "$0")/ TESTDIR=$CURDIR/../../.. NR_ITER=100 SESSION_NAME="multi-session" EVENT_NAME="ust_gen_nevents:tptest" NUM_TESTS=28 +# shellcheck source=../../../utils/utils.sh source $TESTDIR/utils/utils.sh if [ ! -x "$CURDIR/gen-nevents" ]; then @@ -35,23 +26,23 @@ test_multi_session() { local out # BEFORE application is spawned - for i in `seq 0 3`; do + for i in $(seq 0 3); do create_lttng_session_ok "$SESSION_NAME-$i" "$TRACE_PATH/$i" enable_ust_lttng_event_ok "$SESSION_NAME-$i" "$EVENT_NAME$i" start_lttng_tracing_ok "$SESSION_NAME-$i" done - ./$CURDIR/gen-nevents $NR_ITER & + "./$CURDIR/gen-nevents" $NR_ITER & ok $? "Start application to generate $NR_ITER events" wait pass "Wait for events to record" - for i in `seq 0 3`; do + for i in $(seq 0 3); do stop_lttng_tracing_ok "$SESSION_NAME-$i" - destroy_lttng_session "$SESSION_NAME-$i" - out=$(babeltrace "$TRACE_PATH/$i" | grep "$EVENT_NAMEi$i" | wc -l) - if [ $out -ne $NR_ITER ]; then + destroy_lttng_session_ok "$SESSION_NAME-$i" + out=$($BABELTRACE_BIN "$TRACE_PATH/$i" | grep -c "$EVENT_NAME$i") + if [ "$out" -ne $NR_ITER ]; then fail "Trace validation of $SESSION_NAME-$i" diag "No events found." out=1 @@ -74,7 +65,7 @@ print_test_banner "$TEST_DESC" start_lttng_sessiond -TRACE_PATH=$(mktemp -d) +TRACE_PATH=$(mktemp --tmpdir -d tmp.test_multi_session_ust.XXXXXX) test_multi_session out=$?