Cleanup: tests: name all temporary files to better identify leakage
[lttng-tools.git] / tests / regression / tools / health / test_thread_ok
index add9c0ced96acf39ed1644fc1c21e0c5d9e2de80..e84adb611a00f1531310dd623d109cfa3db84bb2 100755 (executable)
@@ -1,26 +1,14 @@
 #!/bin/bash
 #
-# Copyright (C) 2012 Christian Babeux <christian.babeux@efficios.com>
-# Copyright (C) 2014 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+# Copyright (C) 2012 Christian Babeux <christian.babeux@efficios.com>
+# Copyright (C) 2014 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.
+# SPDX-License-Identifier: GPL-2.0-only
 
 TEST_DESC="Health check - Thread OK"
 
 CURDIR=$(dirname $0)/
 TESTDIR=$CURDIR/../../..
-LTTNG_BIN="lttng"
 SESSION_NAME="health_thread_ok"
 UST_EVENT_NAME="tp:tptest"
 KERNEL_EVENT_NAME="sched_switch"
@@ -31,14 +19,6 @@ SLEEP_TIME=30
 
 source $TESTDIR/utils/utils.sh
 
-function lttng_create_session_uri
-{
-       # Create session with default path
-       $TESTDIR/../src/bin/lttng/$LTTNG_BIN create $SESSION_NAME \
-               -U net://localhost >/dev/null 2>&1
-       ok $? "Create session with default path"
-}
-
 function report_errors
 {
        # Report health errors
@@ -79,9 +59,9 @@ function test_thread_ok
 
        diag "With UST consumer daemons"
        create_lttng_session_no_output $SESSION_NAME
-       enable_ust_lttng_event $SESSION_NAME $UST_EVENT_NAME $CHANNEL_NAME
-       start_lttng_tracing $SESSION_NAME
-       destroy_lttng_session $SESSION_NAME
+       enable_ust_lttng_event_ok $SESSION_NAME $UST_EVENT_NAME $CHANNEL_NAME
+       start_lttng_tracing_ok $SESSION_NAME
+       destroy_lttng_session_ok $SESSION_NAME
 
        # Check health status
        $CURDIR/$HEALTH_CHECK_BIN > ${STDOUT_PATH} 2> ${STDERR_PATH}
@@ -92,8 +72,8 @@ function test_thread_ok
                diag "With kernel consumer daemon"
                create_lttng_session_no_output $SESSION_NAME
                lttng_enable_kernel_event $SESSION_NAME $KERNEL_EVENT_NAME $CHANNEL_NAME
-               start_lttng_tracing $SESSION_NAME
-               destroy_lttng_session $SESSION_NAME
+               start_lttng_tracing_ok $SESSION_NAME
+               destroy_lttng_session_ok $SESSION_NAME
 
                # Check health status
                $CURDIR/$HEALTH_CHECK_BIN > ${STDOUT_PATH} 2> ${STDERR_PATH}
@@ -130,10 +110,10 @@ plan_tests $NUM_TESTS
 
 print_test_banner "$TEST_DESC"
 
-STDOUT_PATH=$(mktemp)
-STDERR_PATH=$(mktemp)
-TRACE_PATH=$(mktemp -d)
-HEALTH_PATH=$(mktemp -d)
+STDOUT_PATH=$(mktemp --tmpdir tmp.test_thread_ok_stdout_path.XXXXXX)
+STDERR_PATH=$(mktemp --tmpdir tmp.test_thread_ok_stderr_path.XXXXXX)
+TRACE_PATH=$(mktemp --tmpdir -d tmp.test_thread_ok_trace_path.XXXXXX)
+HEALTH_PATH=$(mktemp --tmpdir -d tmp.test_thread_ok_trace_path.XXXXXX)
 
 # The manage kernel thread is only spawned if we are root
 if [ "$(id -u)" == "0" ]; then
This page took 0.02422 seconds and 4 git commands to generate.