Cleanup: tests: name all temporary files to better identify leakage
[lttng-tools.git] / tests / regression / tools / mi / test_mi
index 3feff4ac5a7c8978819efae74e7786a088f389a9..db5dec50e0a6d5b7fff5efc0b72c3c9f80b18f39 100755 (executable)
@@ -1,19 +1,8 @@
 #!/bin/bash
 #
-# Copyright (C) 2014 Jonathan Rajotte <jonathan.r.julien@gmail.com>
+# Copyright (C) 2014 Jonathan Rajotte <jonathan.r.julien@gmail.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="Machine interface testing"
 
@@ -29,8 +18,8 @@ NR_USEC_WAIT=0
 NR_ITER=10000
 
 #Temp file output
-OUTPUT_DIR=$(mktemp -d)
-SESSIOND_LOAD_DIR=$(mktemp -d)
+OUTPUT_DIR=$(mktemp --tmpdir -d tmp.test_mi_output_dir.XXXXXX)
+SESSIOND_LOAD_DIR=$(mktemp --tmpdir -d tmp.test_mi_sessiond_load_dir.XXXXXX)
 OUTPUT_FILE="default.xml"
 
 #Path to custom xml utilities
@@ -50,8 +39,8 @@ XPATH_LIST_UST_EVENT="$XPATH_CMD_OUTPUT/lttng:domains/lttng:domain[./lttng:type
 XPATH_SNAPSHOT_ADD_SNAPSHOT="$XPATH_CMD_OUTPUT/lttng:snapshot_action[./lttng:name = 'add-output']/lttng:output"
 XPATH_SNAPSHOT_LIST="$XPATH_CMD_OUTPUT/lttng:snapshot_action[./lttng:name = 'list-output']/lttng:output"
 XPATH_SNAPSHOT_DEL="$XPATH_CMD_OUTPUT/lttng:snapshot_action[./lttng:name = 'del-output']/lttng:output"
-XPATH_TRACK_UNTRACK_VPID="$XPATH_CMD_OUTPUT/lttng:trackers/lttng:vpid_tracker/lttng:targets/lttng:vpid_target/lttng:type"
-XPATH_VPID_TRACKER="$XPATH_CMD_OUTPUT/lttng:sessions/lttng:session/lttng:domains/lttng:domain/lttng:trackers/lttng:vpid_tracker"
+XPATH_TRACK_UNTRACK_VPID="$XPATH_CMD_OUTPUT/lttng:process_attr_trackers/lttng:vpid_process_attr_tracker/lttng:process_attr_values/lttng:vpid/lttng:type"
+XPATH_VPID_TRACKER="$XPATH_CMD_OUTPUT/lttng:sessions/lttng:session/lttng:domains/lttng:domain/lttng:process_attr_trackers/lttng:vpid_process_attr_tracker"
 
 DEVNULL=/dev/null 2>&1
 
@@ -535,8 +524,8 @@ function test_list_session ()
 
 function test_list_ust_event ()
 {
-       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")
 
        OUTPUT_FILE="list_ust_event.xml"
 
@@ -777,7 +766,7 @@ function test_track_untrack ()
        ok $? "Mi test: session list with pid_tracker validate"
 
        #Check the good count
-       extract_xml $OUTPUT_DEST $XPATH_VPID_TRACKER"/lttng:targets/lttng:vpid_target/lttng:type/lttng:id" result
+       extract_xml $OUTPUT_DEST $XPATH_VPID_TRACKER"/lttng:process_attr_values/lttng:vpid/lttng:type/lttng:id" result
        num=$(echo "$result" | wc -l)
        test "$num" -eq "3"
        ok $? "Mi test: tracker pid listing expecting 3 target got $num"
@@ -969,7 +958,7 @@ do
        fi
 done
 rm -rf $OUTPUT_DIR
-rm -rf $FOO_LOAD_DIR
+rm -rf $SESSIOND_LOAD_DIR
 
 OUTPUT_DEST=/dev/null 2>&1
 stop_lttng_sessiond
This page took 0.024731 seconds and 4 git commands to generate.