Fix: test: use BABELTRACE_BIN instead of babeltrace
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Tue, 23 Nov 2021 17:15:42 +0000 (12:15 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 17 Dec 2021 04:46:25 +0000 (23:46 -0500)
Observed issue
==============

The System tests jobs fails on multi-session test since the move to bt2.

Cause
=====

The tests uses `babeltrace` instead of `BABELTRACE_BIN`.

Solution
========

Use `BABELTRACE_BIN`.

Add a babelrace bail out.

While there fix easy shellcheck warning.

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I441d736e85c447c5765bffd520ec2f267c86048f

tests/regression/ust/multi-session/test_multi_session

index ba73b7d2086e746b1d2ec7329df0fc23adba6129..93fc9a00ceadf4144a703b1e87c7e4c8689a912d 100755 (executable)
@@ -6,13 +6,14 @@
 
 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
@@ -25,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_ok "$SESSION_NAME-$i"
-               out=$(babeltrace "$TRACE_PATH/$i" | grep "$EVENT_NAMEi$i" | wc -l)
-               if [ $out -ne $NR_ITER ]; then
+               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
This page took 0.026482 seconds and 4 git commands to generate.