Tests: use babeltrace2 for all tests
[lttng-tools.git] / tests / regression / tools / relayd-grouping / test_ust
index 85d7197e6633e562d52e9139d8d3eb212aff87cc..eecf952074e49a7c919bd4d0fe48abffca9cfe1d 100755 (executable)
@@ -1,19 +1,8 @@
 #!/bin/bash
 #
-# Copyright (C) 2018 Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
+# Copyright (C) 2018 Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
 #
-# 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="LTTng relayd filesystem grouping - Userspace tracing"
 
@@ -27,15 +16,9 @@ TESTAPP_BIN="$TESTAPP_PATH/$TESTAPP_NAME/$TESTAPP_NAME"
 EVENT_NAME="tp:tptest"
 CHANNEL_NAME="my_channel"
 
-XSD_PATH=$TESTDIR/../src/common/mi-lttng-3.0.xsd
-
-XML_VALIDATE="$TESTDIR/regression/tools/mi/validate_xml $XSD_PATH"
-XML_EXTRACT="$TESTDIR/regression/tools/mi/extract_xml"
-
 XPATH_CMD_OUTPUT="//lttng:command/lttng:output"
 XPATH_SESSION="$XPATH_CMD_OUTPUT/lttng:sessions/lttng:session"
 
-
 NUM_TESTS=688
 
 source "$TESTDIR/utils/utils.sh"
@@ -51,14 +34,15 @@ function get_auto_session_name ()
        local lttng_bin=$LTTNG_BIN
 
        LTTNG_BIN="${lttng_bin} --mi xml"
-       OUTPUT_DEST=$(mktemp)
+       OUTPUT_DEST=$(mktemp --tmpdir "tmp.${FUNCNAME[0]}_output.XXXXXX")
 
        list_lttng_with_opts
-       $XML_VALIDATE "$OUTPUT_DEST"
+       $MI_VALIDATE "$OUTPUT_DEST"
        ok $? "Valid lttng list XML"
 
        value=$($XML_EXTRACT "$OUTPUT_DEST" ${XPATH_SESSION}/lttng:name/text\(\))
        ok $? "Extraction of session name"
+       rm -f $OUTPUT_DEST
        OUTPUT_DEST=/dev/null
        LTTNG_BIN=$lttng_bin
 
@@ -473,8 +457,8 @@ function test_ust_pid_streaming_snapshot ()
        local file_sync_after_first
        local file_sync_before_last
 
-       file_sync_after_first=$(mktemp -u)
-       file_sync_before_last=$(mktemp -u)
+       file_sync_after_first=$(mktemp --tmpdir -u "tmp.${FUNCNAME[0]}_sync_after_first.XXXXXX")
+       file_sync_before_last=$(mktemp --tmpdir -u "tmp.${FUNCNAME[0]}_sync_before_last.XXXXXX")
 
        if [ -z "$session_name" ]; then
                is_automatic_session=true
@@ -658,6 +642,7 @@ plan_tests $NUM_TESTS
 
 print_test_banner "$TEST_DESC"
 
+bail_out_if_no_babeltrace
 
 tests=(
        test_ust_uid_live
@@ -687,7 +672,7 @@ for fct_test in "${tests[@]}";
 do
        for grouping in "${grouping_types[@]}";
        do
-               TRACE_PATH=$(mktemp -d)
+               TRACE_PATH=$(mktemp --tmpdir -d tmp.test_relayd_grouping_ust_trace_path.XXXXXX)
                # Set the relayd in --group-output-by-session mode
                start_lttng_relayd "-o $TRACE_PATH $grouping"
                start_lttng_sessiond
This page took 0.023931 seconds and 4 git commands to generate.