Cleanup: tests: name all temporary files to better identify leakage
[lttng-tools.git] / tests / regression / tools / snapshots / test_kernel
index 06d16c75703b3b842917cceb6e44a7fd1dc98088..8cac901e7dff69d0da3e6fc9fc5d651becbcdd55 100755 (executable)
@@ -1,19 +1,9 @@
 #!/bin/bash
 #
-# Copyright (C) 2013 Julien Desfossez <jdesfossez@efficios.com>
+# Copyright (C) 2013 Julien Desfossez <jdesfossez@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="Snapshots - Kernel tracing"
 
 CURDIR=$(dirname $0)/
@@ -22,9 +12,9 @@ EVENT_NAME="sched_switch"
 SESSION_NAME=""
 CHANNEL_NAME="snapchan"
 
-TRACE_PATH=$(mktemp -d)
+TRACE_PATH=$(mktemp --tmpdir -d tmp.test_snapshots_kernel_trace_path.XXXXXX)
 
-NUM_TESTS=2060
+NUM_TESTS=2061
 
 source $TESTDIR/utils/utils.sh
 
@@ -41,12 +31,11 @@ function test_kernel_local_snapshot ()
        destroy_lttng_session_ok $SESSION_NAME
 
        # Validate test
+       validate_trace_path_kernel_snapshot "$TRACE_PATH" "" "snapshot-1" 0 ""
        validate_trace $EVENT_NAME $TRACE_PATH/
        if [ $? -eq 0 ]; then
                # Only delete if successful
                rm -rf $TRACE_PATH
-       else
-               break
        fi
 }
 
@@ -148,9 +137,9 @@ function test_kernel_local_snapshot_discard ()
        rm -rf $TRACE_PATH
 
        if [ x"$FIRST_LINE" != x"$FIRST_LINE_2" ]; then
-               fail "First snapshot event do not match."
+               fail "First snapshot event do not match"
        else
-               pass "First snapshot event match."
+               pass "First snapshot event match"
        fi
 
        stop_lttng_tracing_ok $SESSION_NAME
@@ -186,9 +175,9 @@ function test_kernel_local_snapshot_overwrite_small_buffers ()
        rm -rf $TRACE_PATH
 
        if [ x"$FIRST_LINE" != x"$FIRST_LINE_2" ]; then
-               pass "First snapshot event do not match."
+               pass "First snapshot event do not match"
        else
-               fail "First snapshot event match."
+               fail "First snapshot event match"
        fi
 
        stop_lttng_tracing_ok $SESSION_NAME
@@ -232,7 +221,7 @@ else
        isroot=0
 fi
 
-skip $isroot "Root access is needed. Skipping all kernel snapshot tests." $NUM_TESTS ||
+skip $isroot "Root access is needed. Skipping all kernel snapshot tests" $NUM_TESTS ||
 {
 
        validate_lttng_modules_present
This page took 0.026466 seconds and 5 git commands to generate.