#!/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"
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
# 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
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