X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;ds=sidebyside;f=tests%2Fregression%2Ftools%2Ftracker%2Ftest_event_tracker;h=feb3787155f8d74ca3914e6fdb80b49edb35c24d;hb=33e557114a2ba28e26e220a833e8a449c78b8b65;hp=b4563b333c26a443440703bb11629b667ea310cc;hpb=14d3fca9eddbb059a9dae789affd561cf87337e4;p=lttng-tools.git diff --git a/tests/regression/tools/tracker/test_event_tracker b/tests/regression/tools/tracker/test_event_tracker index b4563b333..feb378715 100755 --- a/tests/regression/tools/tracker/test_event_tracker +++ b/tests/regression/tools/tracker/test_event_tracker @@ -1,20 +1,9 @@ #!/bin/bash # -# Copyright (C) - 2013 Christian Babeux -# Copyright (C) - 2015-2018 Mathieu Desnoyers +# Copyright (C) 2013 Christian Babeux +# Copyright (C) 2015-2018 Mathieu Desnoyers # -# 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="LTTng - Event traker test" @@ -28,7 +17,7 @@ TESTAPP_KERNEL_BIN="$TESTAPP_PATH/$TESTAPP_KERNEL_NAME/$TESTAPP_KERNEL_NAME" SESSION_NAME="tracker" NR_ITER=100 NUM_GLOBAL_TESTS=2 -NUM_UST_TESTS=265 +NUM_UST_TESTS=283 NUM_KERNEL_TESTS=462 NUM_TESTS=$((NUM_UST_TESTS+NUM_KERNEL_TESTS+NUM_GLOBAL_TESTS)) @@ -48,8 +37,8 @@ source $TESTDIR/utils/utils.sh function prepare_ust_app { - AFTER_FIRST_PATH=$(mktemp -u) - BEFORE_LAST_PATH=$(mktemp -u) + AFTER_FIRST_PATH=$(mktemp --tmpdir -u tmp.${FUNCNAME[0]}_sync_after_first.XXXXXX) + BEFORE_LAST_PATH=$(mktemp --tmpdir -u tmp.${FUNCNAME[0]}_sync_before_last.XXXXXX) $TESTAPP_BIN -i $NR_ITER -w $NR_USEC_WAIT -a "$AFTER_FIRST_PATH" -b "$BEFORE_LAST_PATH" & CHILD_PID=$! @@ -66,7 +55,7 @@ function trace_ust_app function prepare_kernel_app { - WAIT_PATH=$(mktemp -u) + WAIT_PATH=$(mktemp --tmpdir -u "tmp.${FUNCNAME[0]}_wait_path.XXXXXX") "$TESTAPP_KERNEL_BIN" "$WAIT_PATH" $NR_ITER & CHILD_PID=$! @@ -89,7 +78,7 @@ function test_event_tracker() local tracker="$4" local channel='' - trace_path=$(mktemp -d) + trace_path=$(mktemp --tmpdir -d tmp.${FUNCNAME[0]}_trace_path.XXXXXX) create_lttng_session_ok $SESSION_NAME "$trace_path" @@ -128,7 +117,7 @@ function test_event_vpid_tracker() local wildcard="$3" local channel='' - trace_path=$(mktemp -d) + trace_path=$(mktemp --tmpdir -d tmp.${FUNCNAME[0]}_trace_path.XXXXXX) create_lttng_session_ok $SESSION_NAME "$trace_path" @@ -171,7 +160,7 @@ function test_event_pid_tracker() local wildcard="$3" local channel='' - trace_path=$(mktemp -d) + trace_path=$(mktemp --tmpdir -d tmp.${FUNCNAME[0]}_trace_path.XXXXXX) create_lttng_session_ok $SESSION_NAME "$trace_path" @@ -214,7 +203,7 @@ function test_event_tracker_fail() local wildcard="$2" local tracker="$3" - trace_path=$(mktemp -d) + trace_path=$(mktemp --tmpdir -d tmp.${FUNCNAME[0]}_trace_path.XXXXXX) create_lttng_session_ok $SESSION_NAME "$trace_path" enable_"$domain"_lttng_event_ok $SESSION_NAME "$wildcard" @@ -233,7 +222,7 @@ function test_event_track_untrack() local tracker="$4" local channel='' - trace_path=$(mktemp -d) + trace_path=$(mktemp --tmpdir -d tmp.${FUNCNAME[0]}_trace_path.XXXXXX) create_lttng_session_ok $SESSION_NAME "$trace_path" @@ -273,7 +262,7 @@ function test_event_vpid_track_untrack() local wildcard="$3" local channel='' - trace_path=$(mktemp -d) + trace_path=$(mktemp --tmpdir -d tmp.${FUNCNAME[0]}_trace_path.XXXXXX) create_lttng_session_ok $SESSION_NAME "$trace_path" @@ -313,7 +302,7 @@ function test_event_pid_track_untrack() local wildcard="$3" local channel='' - trace_path=$(mktemp -d) + trace_path=$(mktemp --tmpdir -d tmp.${FUNCNAME[0]}_trace_path.XXXXXX) create_lttng_session_ok $SESSION_NAME "$trace_path" @@ -347,9 +336,7 @@ function test_event_pid_track_untrack() function test_event_ust_vpid_untrack_snapshot() { - local trace_path - - trace_path=$(mktemp -d) + local trace_path=$(mktemp --tmpdir -d tmp.${FUNCNAME[0]}_trace_path.XXXXXX) diag "Test_event_ust_vpid_untrack_snapshot" @@ -390,6 +377,10 @@ fi EVENT_NAME="tp:tptest" +# Both ordering of tracker type and `--all` are valid. +test_event_track_untrack ust 0 "${EVENT_NAME}" "--vgid --all" +test_event_track_untrack ust 0 "${EVENT_NAME}" "--all --vgid" + #vuid, vgid # non-matching @@ -544,7 +535,7 @@ skip $isroot "Root access is needed. Skipping all kernel tracker tests." $NUM_KE test_event_tracker kernel 1 "${EVENT_NAME}" "--pid --all" test_event_pid_tracker kernel 1 "${EVENT_NAME}" - rmmod lttng-test + modprobe --remove lttng-test ok $? "Unloading lttng-test module" }