Tests: use babeltrace2 for all tests
[lttng-tools.git] / tests / regression / ust / java-log4j / test_java_log4j
index a47060559cffcfbace207ab37a0c0b671a25c5e7..ed4302879e5ac183f3de1b2e2d987773846e3ce1 100755 (executable)
@@ -1,19 +1,8 @@
 #!/bin/bash
 #
-# Copyright (C) 2014 David Goulet <dgoulet@efficios.com>
+# Copyright (C) 2014 David Goulet <dgoulet@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="Java LOG4J support"
 
@@ -91,8 +80,8 @@ function enable_log4j_filter_loglevel_only()
 
 function test_log4j_before_start ()
 {
-       local file_sync_after_first=$(mktemp -u)
-       local file_sync_before_last=$(mktemp -u)
+       local file_sync_after_first=$(mktemp --tmpdir -u "tmp.${FUNCNAME[0]}_sync_after_first.XXXXXX")
+       local file_sync_before_last=$(mktemp --tmpdir -u "tmp.${FUNCNAME[0]}_sync_before_last.XXXXXX")
 
        diag "Test LOG4J application BEFORE tracing starts"
        create_lttng_session_ok $SESSION_NAME $TRACE_PATH
@@ -672,6 +661,8 @@ plan_tests $NUM_TESTS
 
 print_test_banner "$TEST_DESC"
 
+bail_out_if_no_babeltrace
+
 if [ ! -f "$TESTAPP_PATH.class" ]; then
        withapp=0
 else
@@ -704,7 +695,7 @@ skip $withapp "LOG4J support is needed. Skipping all tests." $NUM_TESTS ||
 
        for fct_test in ${tests[@]};
        do
-               TRACE_PATH=$(mktemp -d)
+               TRACE_PATH=$(mktemp --tmpdir -d tmp.test_java_log4j_trace_path.XXXXXX)
 
                ${fct_test}
                if [ $? -ne 0 ]; then
This page took 0.023923 seconds and 4 git commands to generate.