-# Copyright (C) - 2012 David Goulet <dgoulet@efficios.com>
+# Copyright (C) 2012 David Goulet <dgoulet@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.
+# SPDX-License-Identifier: LGPL-2.1-only
#
-# 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
SESSIOND_BIN="lttng-sessiond"
SESSIOND_MATCH=".*lttng-sess.*"
source $TESTDIR/utils/tap/tap.sh
-if [ -z $LTTNG_TEST_TEARDOWN_TIMEOUT ]; then
+if [ -z ${LTTNG_TEST_TEARDOWN_TIMEOUT+x} ]; then
LTTNG_TEST_TEARDOWN_TIMEOUT=60
fi
function lttng_track()
{
- local expected_to_fail=$1
- local opts=$2
+ local expected_to_fail="$1"
+ shift 1
+ local opts="$@"
$TESTDIR/../src/bin/lttng/$LTTNG_BIN track $opts >$OUTPUT_DEST
ret=$?
if [[ $expected_to_fail -eq "1" ]]; then
function lttng_untrack()
{
- local expected_to_fail=$1
- local opts=$2
+ local expected_to_fail="$1"
+ shift 1
+ local opts="$@"
$TESTDIR/../src/bin/lttng/$LTTNG_BIN untrack $opts >$OUTPUT_DEST
ret=$?
if [[ $expected_to_fail -eq "1" ]]; then
ok $? "Lttng untrack all pid on the kernel domain"
}
+function lttng_track_ust_ok()
+{
+ lttng_track_ok -u "$@"
+}
+
+function lttng_track_ust_fail()
+{
+ lttng_track_fail -u "$@"
+}
+
+function lttng_track_kernel_ok()
+{
+ lttng_track_ok -k "$@"
+}
+
+function lttng_track_kernel_fail()
+{
+ lttng_track_fail -k "$@"
+}
+
+function lttng_untrack_ust_ok()
+{
+ lttng_untrack_ok -u "$@"
+}
+
+function lttng_untrack_ust_fail()
+{
+ lttng_untrack_fail -u "$@"
+}
+
+function lttng_untrack_kernel_ok()
+{
+ lttng_untrack_ok -k "$@"
+}
+
+function lttng_untrack_kernel_fail()
+{
+ lttng_untrack_fail -k "$@"
+}
+
function lttng_add_context_list()
{
$TESTDIR/../src/bin/lttng/$LTTNG_BIN add-context --list 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
return $ret
}
+function validate_folder_is_empty()
+{
+ local folder=$1
+
+ test -z "$(ls -A "$folder")"
+ ok $? "Folder ${folder} is empty"
+}
+
+function validate_trace_session_ust_empty()
+{
+ validate_folder_is_empty "$1"/ust
+}
+
+function validate_trace_session_kernel_empty()
+{
+ validate_trace_empty "$1"/kernel
+}
+
function regenerate_metadata ()
{
local expected_to_fail=$1