Move xml utils from mi subfolder to xml-utils folder
[lttng-tools.git] / tests / regression / tools / rotation / test_save_load_mi
index 80500b40fa5f7bbc1efcd0cd97c0dda267e8927d..cb205084111569eaa81de1650ed3af18a01a47a0 100755 (executable)
@@ -1,19 +1,8 @@
 #!/bin/bash
 #
-# Copyright (C) 2017 Julien Desfossez <jdesfossez@efficios.com>
+# Copyright (C) 2017 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="Rotation - Save/Load/List/MI"
 
@@ -31,8 +20,8 @@ LTTNG_BIN="lttng --mi xml"
 
 XSD_PATH=$TESTDIR/../src/common/mi-lttng-4.0.xsd
 
-XML_VALIDATE="$TESTDIR/regression/tools/mi/validate_xml $XSD_PATH"
-XML_EXTRACT="$TESTDIR/regression/tools/mi/extract_xml"
+XML_VALIDATE="$TESTDIR/utils/xml-utils/validate_xml $XSD_PATH"
+XML_EXTRACT="$TESTDIR/utils/xml-utils/extract_xml"
 
 XPATH_CMD_OUTPUT="//lttng:command/lttng:output"
 XPATH_SESSION="$XPATH_CMD_OUTPUT/lttng:sessions/lttng:session"
@@ -44,9 +33,9 @@ XPATH_LIST_ROTATE_SIZE="$XPATH_SESSION/lttng:rotation_schedules/lttng:size_thres
 
 function test_save_load_mi ()
 {
-       tmp_xml_output=$(mktemp -u)
-       tmp_save_output=$(mktemp -d)
-       trace_path=$(mktemp -d)
+       local tmp_xml_output=$(mktemp --tmpdir -u -t "tmp.${FUNCNAME[0]}_xml_output.XXXXXX")
+       local tmp_save_output=$(mktemp --tmpdir -d -t "tmp.${FUNCNAME[0]}_save_output.XXXXXX")
+       local trace_path=$(mktemp --tmpdir -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX")
 
        diag "Test save/load/list/MI with rotation"
        create_lttng_session_ok $SESSION_NAME $trace_path
@@ -87,9 +76,9 @@ function test_save_load_mi ()
 
        # save, destroy and reload the same session
        OUTPUT_DEST=/dev/null
-       lttng_save $SESSION_NAME "-o $tmp_save_output$SESSION_NAME"
+       lttng_save $SESSION_NAME "-o $tmp_save_output/$SESSION_NAME"
        destroy_lttng_session_ok $SESSION_NAME
-       lttng_load_ok "-i $tmp_save_output$SESSION_NAME"
+       lttng_load_ok "-i $tmp_save_output/$SESSION_NAME"
 
        OUTPUT_DEST=${tmp_xml_output}
        # Check the output of lttng list with the 2 rotation parameters after the load
@@ -108,9 +97,9 @@ function test_save_load_mi ()
        OUTPUT_DEST=/dev/null
        destroy_lttng_session_ok $SESSION_NAME
 
-       rm -rf ${trace_path}
-       rm $tmp_xml_output
-       rm -rf $tmp_save_output
+       rm -rf "$trace_path"
+       rm "$tmp_xml_output"
+       rm -rf "$tmp_save_output"
 }
 
 plan_tests $NUM_TESTS
This page took 0.026873 seconds and 5 git commands to generate.