From 8d5a3312b34841f1ecba2605acad3eaca79fd5e4 Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Fri, 16 Jul 2021 17:52:35 -0400 Subject: [PATCH] port: add support for BSD mktemp MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Use '-t' which is portable instead of the GNU specific '--tmpdir'. Change-Id: I430af6b96c27c2766a2cc4b5574af8563297d717 Signed-off-by: Michael Jeanson Signed-off-by: Jérémie Galarneau --- tests/destructive/metadata-regeneration | 10 +-- tests/perf/test_perf_raw.in | 4 +- tests/regression/kernel/test_all_events | 2 +- tests/regression/kernel/test_callstack | 6 +- tests/regression/kernel/test_channel | 4 +- tests/regression/kernel/test_clock_override | 6 +- tests/regression/kernel/test_event_basic | 4 +- tests/regression/kernel/test_kernel_function | 2 +- tests/regression/kernel/test_lttng_logger | 6 +- tests/regression/kernel/test_ns_contexts | 2 +- .../regression/kernel/test_ns_contexts_change | 8 +-- .../kernel/test_rotation_destroy_flush | 2 +- .../regression/kernel/test_select_poll_epoll | 44 ++++++------ tests/regression/kernel/test_syscall | 48 ++++++------- tests/regression/kernel/test_userspace_probe | 70 +++++++++---------- tests/regression/tools/base-path/test_ust | 2 +- tests/regression/tools/channel/test_channel | 2 +- tests/regression/tools/clear/test_kernel | 8 +-- tests/regression/tools/clear/test_ust | 22 +++--- tests/regression/tools/crash/test_crash | 24 +++---- .../regression/tools/exclusion/test_exclusion | 10 +-- .../tools/filtering/test_invalid_filter | 2 +- .../tools/filtering/test_unsupported_op | 2 +- .../tools/filtering/test_valid_filter | 2 +- tests/regression/tools/health/test_health.sh | 8 +-- tests/regression/tools/health/test_thread_ok | 8 +-- tests/regression/tools/live/test_kernel | 2 +- tests/regression/tools/live/test_lttng_kernel | 2 +- tests/regression/tools/live/test_lttng_ust | 2 +- tests/regression/tools/live/test_ust | 4 +- .../tools/live/test_ust_tracefile_count | 4 +- tests/regression/tools/metadata/test_kernel | 6 +- tests/regression/tools/metadata/test_ust | 10 +-- tests/regression/tools/mi/test_mi | 8 +-- .../test_notification_kernel_buffer_usage | 11 +-- .../test_notification_kernel_capture | 2 +- .../test_notification_kernel_error | 2 +- .../test_notification_kernel_instrumentation | 2 +- .../test_notification_kernel_syscall | 2 +- .../test_notification_kernel_userspace_probe | 2 +- .../notification/test_notification_multi_app | 14 ++-- ...test_notification_notifier_discarded_count | 15 ++-- .../test_notification_ust_buffer_usage | 11 +-- .../test_notification_ust_capture | 2 +- .../notification/test_notification_ust_error | 2 +- ...ication_ust_event_rule_condition_exclusion | 2 +- .../tools/notification/test_rotation | 4 +- .../tools/regen-metadata/test_kernel | 2 +- .../regression/tools/regen-metadata/test_ust | 18 ++--- .../tools/regen-statedump/test_kernel | 2 +- .../regression/tools/regen-statedump/test_ust | 6 +- .../regression/tools/relayd-grouping/test_ust | 8 +-- tests/regression/tools/rotation/test_kernel | 2 +- .../tools/rotation/test_save_load_mi | 6 +- .../tools/rotation/test_schedule_api | 2 +- tests/regression/tools/rotation/test_ust | 2 +- .../regression/tools/rotation/test_ust_kernel | 2 +- .../regression/tools/save-load/test_autoload | 4 +- tests/regression/tools/save-load/test_load | 14 ++-- tests/regression/tools/save-load/test_save | 2 +- tests/regression/tools/snapshots/test_kernel | 2 +- .../tools/snapshots/test_kernel_streaming | 2 +- .../tools/snapshots/test_ust_streaming | 4 +- tests/regression/tools/snapshots/ust_test | 4 +- .../streaming/test_high_throughput_limits | 6 +- tests/regression/tools/streaming/test_kernel | 2 +- tests/regression/tools/streaming/test_ust | 6 +- .../tracefile-limits/test_tracefile_count | 2 +- .../tracefile-limits/test_tracefile_size | 4 +- .../tools/tracker/test_event_tracker | 22 +++--- .../tools/trigger/hidden/test_hidden_trigger | 2 +- .../trigger/rate-policy/test_ust_rate_policy | 4 +- .../tools/trigger/start-stop/test_start_stop | 8 +-- .../tools/trigger/test_add_trigger_cli | 8 +-- .../tools/trigger/test_list_triggers_cli | 8 +-- .../tools/trigger/test_remove_trigger_cli | 10 +-- .../tools/wildcard/test_event_wildcard | 4 +- .../test_relayd_working_directory | 20 +++--- .../ust/before-after/test_before_after | 8 +-- tests/regression/ust/blocking/test_blocking | 2 +- .../ust/buffers-pid/test_buffers_pid | 10 +-- .../ust/clock-override/test_clock_override | 6 +- .../ust/getcpu-override/test_getcpu_override | 2 +- .../ust/high-throughput/test_high_throughput | 6 +- tests/regression/ust/java-jul/test_java_jul | 6 +- .../regression/ust/java-log4j/test_java_log4j | 6 +- .../test_agent_log4j2_domain_log4j | 6 +- .../ust/low-throughput/test_low_throughput | 2 +- tests/regression/ust/multi-lib/test_multi_lib | 2 +- .../ust/multi-session/test_multi_session | 2 +- .../ust/namespaces/test_ns_contexts | 2 +- .../ust/namespaces/test_ns_contexts_change | 6 +- .../regression/ust/nprocesses/test_nprocesses | 6 +- tests/regression/ust/overlap/test_overlap | 2 +- .../test_periodical_metadata_flush | 4 +- .../ust/python-logging/test_python_logging.in | 8 +-- .../test_rotation_destroy_flush | 2 +- tests/regression/ust/test_event_basic | 2 +- tests/regression/ust/test_event_perf | 4 +- tests/regression/ust/test_event_tracef | 2 +- .../stress/test_multi_sessions_per_uid_10app | 2 +- ...test_multi_sessions_per_uid_5app_streaming | 2 +- ...essions_per_uid_5app_streaming_kill_relayd | 2 +- tests/utils/utils.sh | 10 +-- 104 files changed, 363 insertions(+), 354 deletions(-) diff --git a/tests/destructive/metadata-regeneration b/tests/destructive/metadata-regeneration index a8b57633f..7311b3002 100755 --- a/tests/destructive/metadata-regeneration +++ b/tests/destructive/metadata-regeneration @@ -18,7 +18,7 @@ TESTDIR=$CURDIR/.. NUM_TESTS=44 SESSION_NAME="regen" KERNEL_EVENT_NAME="lttng_test_filter_event" -TRACE_PATH=$(mktemp --tmpdir -d -t tmp.metadata_regen_after_data_change.XXXXXX) +TRACE_PATH=$(mktemp -d -t tmp.metadata_regen_after_data_change.XXXXXX) TESTAPP_PATH="$TESTDIR/utils/testapp" TESTAPP_NAME="gen-ust-events" @@ -110,8 +110,8 @@ function test_ust_local () local file_sync_after_first local file_sync_before_last - file_sync_after_first=$(mktemp --tmpdir -u -t "tmp.${FUNCNAME[0]}_sync_after_first.XXXXXX") - file_sync_before_last=$(mktemp --tmpdir -u -t "tmp.${FUNCNAME[0]}_sync_before_last.XXXXXX") + file_sync_after_first=$(mktemp -u -t "tmp.${FUNCNAME[0]}_sync_after_first.XXXXXX") + file_sync_before_last=$(mktemp -u -t "tmp.${FUNCNAME[0]}_sync_before_last.XXXXXX") diag "Test UST local with metadata regeneration" date "+%Y-%m-%d %H:%M" -s "$DATE1 $HOUR" >/dev/null @@ -151,8 +151,8 @@ function test_ust_streaming () local file_sync_after_first local file_sync_before_last - file_sync_after_first=$(mktemp --tmpdir -u -t "tmp.${FUNCNAME[0]}_sync_after_first.XXXXXX") - file_sync_before_last=$(mktemp --tmpdir -u -t "tmp.${FUNCNAME[0]}_sync_before_last.XXXXXX") + file_sync_after_first=$(mktemp -u -t "tmp.${FUNCNAME[0]}_sync_after_first.XXXXXX") + file_sync_before_last=$(mktemp -u -t "tmp.${FUNCNAME[0]}_sync_before_last.XXXXXX") diag "Test UST streaming with metadata regeneration" date "+%Y-%m-%d %H:%M" -s "$DATE1 $HOUR" >/dev/null diff --git a/tests/perf/test_perf_raw.in b/tests/perf/test_perf_raw.in index f293ccd71..0a451ce63 100644 --- a/tests/perf/test_perf_raw.in +++ b/tests/perf/test_perf_raw.in @@ -64,7 +64,7 @@ function test_ust_raw() return fi - TRACE_PATH=$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") create_lttng_session_ok $SESSION_NAME $TRACE_PATH @@ -114,7 +114,7 @@ function test_kernel_raw() return fi - TRACE_PATH=$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") create_lttng_session_ok $SESSION_NAME $TRACE_PATH diff --git a/tests/regression/kernel/test_all_events b/tests/regression/kernel/test_all_events index 2e20888df..2fb2f611d 100755 --- a/tests/regression/kernel/test_all_events +++ b/tests/regression/kernel/test_all_events @@ -17,7 +17,7 @@ source $TESTDIR/utils/utils.sh function test_all_event() { - local TRACE_PATH=$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + local TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") SESSION_NAME="kernel_all_events_basic" create_lttng_session_ok $SESSION_NAME $TRACE_PATH diff --git a/tests/regression/kernel/test_callstack b/tests/regression/kernel/test_callstack index 9e554bbc0..ecbba3066 100755 --- a/tests/regression/kernel/test_callstack +++ b/tests/regression/kernel/test_callstack @@ -36,7 +36,7 @@ function run_workload() # shift the first argument, passing along the other args if any to the # test app. shift - local start_file_sync=$(mktemp --tmpdir -u "tmp.${FUNCNAME[0]}_sync_before_first.XXXXXX") + local start_file_sync=$(mktemp -u -t "tmp.${FUNCNAME[0]}_sync_before_first.XXXXXX") lttng_untrack_all @@ -60,7 +60,7 @@ function run_workload() function test_user_callstack() { - TRACE_PATH=$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") # This is the expected userspace callstack. (see gen-syscall-events-callstack.c) USER_CS_EXPECTED="main fct_a fct_b fct_c my_gettid" EVENT_NAME="gettid" @@ -84,7 +84,7 @@ function test_user_callstack() function test_kernel_callstack() { - TRACE_PATH=$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") # Those are symbol expected to be present in the kernel callstack. This # is not an exhaustive list since it's kernel dependent. diff --git a/tests/regression/kernel/test_channel b/tests/regression/kernel/test_channel index 9cc74c4e8..5525564d2 100755 --- a/tests/regression/kernel/test_channel +++ b/tests/regression/kernel/test_channel @@ -15,7 +15,7 @@ source $TESTDIR/utils/utils.sh function test_channel_buffer() { - TRACE_PATH=$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") SESSION_NAME="test_session_name" CHANNEL_NAME="test_channel_name" create_lttng_session_ok "$SESSION_NAME" "$TRACE_PATH" @@ -30,7 +30,7 @@ function test_channel_buffer() function test_channel_buffer_too_large() { - TRACE_PATH=$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") SESSION_NAME="test_session_name" CHANNEL_NAME="test_channel_name" create_lttng_session_ok "$SESSION_NAME" "$TRACE_PATH" diff --git a/tests/regression/kernel/test_clock_override b/tests/regression/kernel/test_clock_override index 0a44f5f28..524c3c3bb 100755 --- a/tests/regression/kernel/test_clock_override +++ b/tests/regression/kernel/test_clock_override @@ -64,8 +64,8 @@ function extract_clock_metadata_token() function test_clock_override_metadata() { - local ctf_metadata_file=$(mktemp --tmpdir -p $TRACE_PATH ctf-metadata.XXXXXX) - local clock_metadata_file=$(mktemp --tmpdir -p $TRACE_PATH clock-metadata.XXXXXX) + local ctf_metadata_file=$(TMPDIR="$TRACE_PATH" mktemp -t ctf-metadata.XXXXXX) + local clock_metadata_file=$(TMPDIR="$TRACE_PATH" mktemp -t clock-metadata.XXXXXX) local result="" diag "Clock override plugin metadata test" @@ -187,7 +187,7 @@ skip $isroot "Root access is needed. Skipping all tests." $NUM_TESTS || while [ "$i" -lt "$TEST_COUNT" ]; do - TRACE_PATH=$(mktemp --tmpdir -d tmp.test_clock_override_trace_path.XXXXXX) + TRACE_PATH=$(mktemp -d -t tmp.test_clock_override_trace_path.XXXXXX) # Execute test ${TESTS[$i]} diff --git a/tests/regression/kernel/test_event_basic b/tests/regression/kernel/test_event_basic index ac9ec0549..9f22d7db8 100755 --- a/tests/regression/kernel/test_event_basic +++ b/tests/regression/kernel/test_event_basic @@ -17,7 +17,7 @@ source $TESTDIR/utils/utils.sh function test_event_basic() { - TRACE_PATH=$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") SESSION_NAME="kernel_event_basic" create_lttng_session_ok $SESSION_NAME $TRACE_PATH @@ -45,7 +45,7 @@ function test_event_basic() function test_enable_after_start() { - TRACE_PATH=$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") SESSION_NAME="kernel_enable_after_start" create_lttng_session_ok $SESSION_NAME $TRACE_PATH diff --git a/tests/regression/kernel/test_kernel_function b/tests/regression/kernel/test_kernel_function index b1d5491fc..131c1c70b 100755 --- a/tests/regression/kernel/test_kernel_function +++ b/tests/regression/kernel/test_kernel_function @@ -15,7 +15,7 @@ source $TESTDIR/utils/utils.sh function test_kernel_function_basic() { - local TRACE_PATH=$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + local TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") local SESSION_NAME="kernel_function_basic" local EVENT_NAME="my_event_name" local TARGET_SYMBOL="lttng_test_filter_event_write" diff --git a/tests/regression/kernel/test_lttng_logger b/tests/regression/kernel/test_lttng_logger index b8f7ded82..849428807 100755 --- a/tests/regression/kernel/test_lttng_logger +++ b/tests/regression/kernel/test_lttng_logger @@ -19,7 +19,7 @@ function test_proc_logger() { diag "Test /proc/lttng-logger" - local TRACE_PATH=$(mktemp --tmpdir -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + local TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") create_lttng_session_ok $SESSION_NAME $TRACE_PATH @@ -50,7 +50,7 @@ function test_dev_logger() { diag "Test /dev/lttng-logger" - local TRACE_PATH=$(mktemp --tmpdir -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + local TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") create_lttng_session_ok $SESSION_NAME $TRACE_PATH @@ -81,7 +81,7 @@ function test_payload_limit() { diag "Test lttng-logger payload limit" - local TRACE_PATH=$(mktemp --tmpdir -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + local TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") create_lttng_session_ok $SESSION_NAME $TRACE_PATH diff --git a/tests/regression/kernel/test_ns_contexts b/tests/regression/kernel/test_ns_contexts index 0c8718d78..98b673c98 100755 --- a/tests/regression/kernel/test_ns_contexts +++ b/tests/regression/kernel/test_ns_contexts @@ -76,7 +76,7 @@ function test_ns() ns_inode=$(stat -c '%i' -L "/proc/$$/ns/$ns") ok $? "Get current $ns namespace inode: $ns_inode" - trace_path=$(mktemp --tmpdir -d tmp.{FUNCNAME[0]}_trace_path.XXXXXX) + trace_path=$(mktemp -d -t tmp.{FUNCNAME[0]}_trace_path.XXXXXX) start_lttng_sessiond diff --git a/tests/regression/kernel/test_ns_contexts_change b/tests/regression/kernel/test_ns_contexts_change index 42a61276b..715c67cc8 100755 --- a/tests/regression/kernel/test_ns_contexts_change +++ b/tests/regression/kernel/test_ns_contexts_change @@ -80,10 +80,10 @@ function test_ns() return fi - trace_path=$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") - file_sync_wait_before_unshare=$(mktemp --tmpdir -u "tmp.${FUNCNAME[0]}_sync_before_unshare.XXXXXX") - file_sync_wait_after_unshare=$(mktemp --tmpdir -u "tmp.${FUNCNAME[0]}_sync_after_unshare.XXXXXX") - file_sync_signal_after_unshare=$(mktemp --tmpdir -u "tmp.${FUNCNAME[0]}_sync_signal_after_unshare.XXXXXX") + trace_path=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + file_sync_wait_before_unshare=$(mktemp -u -t "tmp.${FUNCNAME[0]}_sync_before_unshare.XXXXXX") + file_sync_wait_after_unshare=$(mktemp -u -t "tmp.${FUNCNAME[0]}_sync_after_unshare.XXXXXX") + file_sync_signal_after_unshare=$(mktemp -u -t "tmp.${FUNCNAME[0]}_sync_signal_after_unshare.XXXXXX") # Get the current ns inode number ns_inode=$(stat -c '%i' -L "/proc/$$/ns/$ns") diff --git a/tests/regression/kernel/test_rotation_destroy_flush b/tests/regression/kernel/test_rotation_destroy_flush index cb773d7df..6e568afda 100755 --- a/tests/regression/kernel/test_rotation_destroy_flush +++ b/tests/regression/kernel/test_rotation_destroy_flush @@ -133,7 +133,7 @@ skip $isroot "Root access is needed. Skipping all tests." $NUM_TESTS || while [ "$i" -lt "$TEST_COUNT" ]; do - TRACE_PATH=$(mktemp --tmpdir -d -t tmp.test_kernel_rotation_destroy_flush.XXXXXX) + TRACE_PATH=$(mktemp -d -t tmp.test_kernel_rotation_destroy_flush.XXXXXX) # Execute test ${TESTS[$i]} diff --git a/tests/regression/kernel/test_select_poll_epoll b/tests/regression/kernel/test_select_poll_epoll index d8245a0e7..db4ffae88 100755 --- a/tests/regression/kernel/test_select_poll_epoll +++ b/tests/regression/kernel/test_select_poll_epoll @@ -48,8 +48,8 @@ function check_trace_content() function test_working_cases() { SESSION_NAME="syscall_payload" - TRACE_PATH=$(mktemp --tmpdir -d "tmp.test_kernel_select_poll_epoll_${FUNCNAME[0]}_trace_path.XXXXXX") - TEST_VALIDATION_OUTPUT_PATH=$(mktemp --tmpdir -u "tmp.test_kernel_select_poll_epoll_${FUNCNAME[0]}_validation.XXXXXX") + TRACE_PATH=$(mktemp -d -t "tmp.test_kernel_select_poll_epoll_${FUNCNAME[0]}_trace_path.XXXXXX") + TEST_VALIDATION_OUTPUT_PATH=$(mktemp -u -t "tmp.test_kernel_select_poll_epoll_${FUNCNAME[0]}_validation.XXXXXX") # arm64 does not have epoll_wait uname -m | grep -E "aarch64" >/dev/null 2>&1 @@ -82,8 +82,8 @@ function test_working_cases() function test_timeout_cases() { SESSION_NAME="syscall_payload" - TRACE_PATH=$(mktemp --tmpdir -d "tmp.test_kernel_select_poll_epoll_${FUNCNAME[0]}_trace_path.XXXXXX") - TEST_VALIDATION_OUTPUT_PATH=$(mktemp --tmpdir -u "tmp.test_kernel_select_poll_epoll_${FUNCNAME[0]}_validation.XXXXXX") + TRACE_PATH=$(mktemp -d -t "tmp.test_kernel_select_poll_epoll_${FUNCNAME[0]}_trace_path.XXXXXX") + TEST_VALIDATION_OUTPUT_PATH=$(mktemp -u -t "tmp.test_kernel_select_poll_epoll_${FUNCNAME[0]}_validation.XXXXXX") # arm64 does not have epoll_wait uname -m | grep -E "aarch64" >/dev/null 2>&1 @@ -117,8 +117,8 @@ function test_pselect_invalid_fd() { SESSION_NAME="syscall_payload" SYSCALL_LIST="pselect6" - TRACE_PATH=$(mktemp --tmpdir -d "tmp.test_kernel_select_poll_epoll_${FUNCNAME[0]}_trace_path.XXXXXX") - TEST_VALIDATION_OUTPUT_PATH=$(mktemp --tmpdir -u "tmp.test_kernel_select_poll_epoll_${FUNCNAME[0]}_validation.XXXXXX") + TRACE_PATH=$(mktemp -d -t "tmp.test_kernel_select_poll_epoll_${FUNCNAME[0]}_trace_path.XXXXXX") + TEST_VALIDATION_OUTPUT_PATH=$(mktemp -u -t "tmp.test_kernel_select_poll_epoll_${FUNCNAME[0]}_validation.XXXXXX") diag "pselect with invalid FD" @@ -144,8 +144,8 @@ function test_big_ppoll() { SESSION_NAME="syscall_payload" SYSCALL_LIST="ppoll" - TRACE_PATH=$(mktemp --tmpdir -d "tmp.test_kernel_select_poll_epoll_${FUNCNAME[0]}_trace_path.XXXXXX") - TEST_VALIDATION_OUTPUT_PATH=$(mktemp --tmpdir -u "tmp.test_kernel_select_poll_epoll_${FUNCNAME[0]}_validation.XXXXXX") + TRACE_PATH=$(mktemp -d -t "tmp.test_kernel_select_poll_epoll_${FUNCNAME[0]}_trace_path.XXXXXX") + TEST_VALIDATION_OUTPUT_PATH=$(mktemp -u -t "tmp.test_kernel_select_poll_epoll_${FUNCNAME[0]}_validation.XXXXXX") diag "ppoll with 2047 FDs" @@ -171,8 +171,8 @@ function test_ppoll_overflow() { SESSION_NAME="syscall_payload" SYSCALL_LIST="ppoll" - TRACE_PATH=$(mktemp --tmpdir -d "tmp.test_kernel_select_poll_epoll_${FUNCNAME[0]}_trace_path.XXXXXX") - TEST_VALIDATION_OUTPUT_PATH=$(mktemp --tmpdir -u "tmp.test_kernel_select_poll_epoll_${FUNCNAME[0]}_validation.XXXXXX") + TRACE_PATH=$(mktemp -d -t "tmp.test_kernel_select_poll_epoll_${FUNCNAME[0]}_trace_path.XXXXXX") + TEST_VALIDATION_OUTPUT_PATH=$(mktemp -u -t "tmp.test_kernel_select_poll_epoll_${FUNCNAME[0]}_validation.XXXXXX") diag "ppoll buffer overflow, should segfault, waits for input" @@ -200,8 +200,8 @@ function test_pselect_invalid_ptr() { SESSION_NAME="syscall_payload" SYSCALL_LIST="pselect6" - TRACE_PATH=$(mktemp --tmpdir -d "tmp.test_kernel_select_poll_epoll_${FUNCNAME[0]}_trace_path.XXXXXX") - TEST_VALIDATION_OUTPUT_PATH=$(mktemp --tmpdir -u "tmp.test_kernel_select_poll_epoll_${FUNCNAME[0]}_validation.XXXXXX") + TRACE_PATH=$(mktemp -d -t "tmp.test_kernel_select_poll_epoll_${FUNCNAME[0]}_trace_path.XXXXXX") + TEST_VALIDATION_OUTPUT_PATH=$(mktemp -u -t "tmp.test_kernel_select_poll_epoll_${FUNCNAME[0]}_validation.XXXXXX") diag "pselect with invalid pointer, waits for input" @@ -227,8 +227,8 @@ function test_ppoll_ulong_max() { SESSION_NAME="syscall_payload" SYSCALL_LIST="ppoll" - TRACE_PATH=$(mktemp --tmpdir -d "tmp.test_kernel_select_poll_epoll_${FUNCNAME[0]}_trace_path.XXXXXX") - TEST_VALIDATION_OUTPUT_PATH=$(mktemp --tmpdir -u "tmp.test_kernel_select_poll_epoll_${FUNCNAME[0]}_validation.XXXXXX") + TRACE_PATH=$(mktemp -d -t "tmp.test_kernel_select_poll_epoll_${FUNCNAME[0]}_trace_path.XXXXXX") + TEST_VALIDATION_OUTPUT_PATH=$(mktemp -u -t "tmp.test_kernel_select_poll_epoll_${FUNCNAME[0]}_validation.XXXXXX") diag "ppoll with ulong_max fds, waits for input" @@ -254,8 +254,8 @@ function test_epoll_pwait_invalid_ptr() { SESSION_NAME="syscall_payload" SYSCALL_LIST="epoll_pwait" - TRACE_PATH=$(mktemp --tmpdir -d "tmp.test_kernel_select_poll_epoll_${FUNCNAME[0]}_trace_path.XXXXXX") - TEST_VALIDATION_OUTPUT_PATH=$(mktemp --tmpdir -u "tmp.test_kernel_select_poll_epoll_${FUNCNAME[0]}_validation.XXXXXX") + TRACE_PATH=$(mktemp -d -t "tmp.test_kernel_select_poll_epoll_${FUNCNAME[0]}_trace_path.XXXXXX") + TEST_VALIDATION_OUTPUT_PATH=$(mktemp -u -t "tmp.test_kernel_select_poll_epoll_${FUNCNAME[0]}_validation.XXXXXX") diag "epoll_pwait with invalid pointer, waits for input" @@ -281,8 +281,8 @@ function test_epoll_pwait_int_max() { SESSION_NAME="syscall_payload" SYSCALL_LIST="epoll_pwait" - TRACE_PATH=$(mktemp --tmpdir -d "tmp.test_kernel_select_poll_epoll_${FUNCNAME[0]}_trace_path.XXXXXX") - TEST_VALIDATION_OUTPUT_PATH=$(mktemp --tmpdir -u "tmp.test_kernel_select_poll_epoll_${FUNCNAME[0]}_validation.XXXXXX") + TRACE_PATH=$(mktemp -d -t "tmp.test_kernel_select_poll_epoll_${FUNCNAME[0]}_trace_path.XXXXXX") + TEST_VALIDATION_OUTPUT_PATH=$(mktemp -u -t "tmp.test_kernel_select_poll_epoll_${FUNCNAME[0]}_validation.XXXXXX") diag "epoll_pwait with maxevents set to INT_MAX, waits for input" @@ -308,8 +308,8 @@ function test_ppoll_concurrent() { SESSION_NAME="syscall_payload" SYSCALL_LIST="ppoll" - TRACE_PATH=$(mktemp --tmpdir -d "tmp.test_kernel_select_poll_epoll_${FUNCNAME[0]}_trace_path.XXXXXX") - TEST_VALIDATION_OUTPUT_PATH=$(mktemp --tmpdir -u "tmp.test_kernel_select_poll_epoll_${FUNCNAME[0]}_validation.XXXXXX") + TRACE_PATH=$(mktemp -d -t "tmp.test_kernel_select_poll_epoll_${FUNCNAME[0]}_trace_path.XXXXXX") + TEST_VALIDATION_OUTPUT_PATH=$(mktemp -u -t "tmp.test_kernel_select_poll_epoll_${FUNCNAME[0]}_validation.XXXXXX") diag "ppoll with concurrent updates of the structure from user-space, stress test (3000 iterations), waits for input + timeout 1ms" @@ -335,8 +335,8 @@ function test_epoll_pwait_concurrent() { SESSION_NAME="syscall_payload" SYSCALL_LIST="epoll_ctl,epoll_pwait" - TRACE_PATH=$(mktemp --tmpdir -d "tmp.test_kernel_select_poll_epoll_${FUNCNAME[0]}_trace_path.XXXXXX") - TEST_VALIDATION_OUTPUT_PATH=$(mktemp --tmpdir -u "tmp.test_kernel_select_poll_epoll_${FUNCNAME[0]}_validation.XXXXXX") + TRACE_PATH=$(mktemp -d -t "tmp.test_kernel_select_poll_epoll_${FUNCNAME[0]}_trace_path.XXXXXX") + TEST_VALIDATION_OUTPUT_PATH=$(mktemp -u -t "tmp.test_kernel_select_poll_epoll_${FUNCNAME[0]}_validation.XXXXXX") diag "epoll_pwait with concurrent munmap of the buffer from user-space, should randomly segfault, run multiple times, waits for input + timeout 1ms" diff --git a/tests/regression/kernel/test_syscall b/tests/regression/kernel/test_syscall index 401a18a8d..f9b490858 100755 --- a/tests/regression/kernel/test_syscall +++ b/tests/regression/kernel/test_syscall @@ -20,7 +20,7 @@ source $TESTDIR/utils/utils.sh function trace_testapp() { - local start_file_sync=$(mktemp --tmpdir -u -t "tmp.${FUNCNAME[0]}_sync_start.XXXXXX") + local start_file_sync=$(mktemp -u -t "tmp.${FUNCNAME[0]}_sync_start.XXXXXX") # Clear all entries from the resource tracker lttng_untrack_kernel_all_ok @@ -72,7 +72,7 @@ function test_syscall_event_list() function test_syscall_simple_list() { - local TRACE_PATH=$(mktemp --tmpdir -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + local TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") SESSION_NAME="kernel_syscall_simple_list" local EVENT_NAME="close" @@ -100,7 +100,7 @@ function test_syscall_simple_list() function test_syscall_simple_list_two() { - local TRACE_PATH=$(mktemp --tmpdir -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + local TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") SESSION_NAME="kernel_syscall_simple_list_two" local EVENT_NAME="close" local EVENT_NAME2="read" @@ -134,7 +134,7 @@ function test_syscall_simple_list_two() function test_syscall_single() { - local TRACE_PATH=$(mktemp --tmpdir -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + local TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") SESSION_NAME="kernel_syscall_single" diag "Syscall trace single" @@ -159,7 +159,7 @@ function test_syscall_single() function test_syscall_two() { - local TRACE_PATH=$(mktemp --tmpdir -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + local TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") SESSION_NAME="kernel_syscall_two" diag "Syscall trace two events" @@ -187,7 +187,7 @@ function test_syscall_two() function test_syscall_all() { - local TRACE_PATH=$(mktemp --tmpdir -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + local TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") SESSION_NAME="kernel_syscall_all" diag "Syscall trace all events" @@ -213,7 +213,7 @@ function test_syscall_all() function test_syscall_all_disable_one() { - local TRACE_PATH=$(mktemp --tmpdir -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + local TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") SESSION_NAME="kernel_syscall_all_disable_one" diag "Syscall trace all events and disable one" @@ -242,7 +242,7 @@ function test_syscall_all_disable_one() function test_syscall_all_disable_two() { - local TRACE_PATH=$(mktemp --tmpdir -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + local TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") SESSION_NAME="kernel_syscall_all_disable_two" diag "Syscall trace all events and disable two" @@ -276,7 +276,7 @@ function test_syscall_all_disable_two() function test_syscall_enable_all_disable_all() { - local TRACE_PATH=$(mktemp --tmpdir -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + local TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") SESSION_NAME="kernel_syscall_enable_all_disable_all" diag "Syscall trace all events and disable all" @@ -300,7 +300,7 @@ function test_syscall_enable_all_disable_all() function test_syscall_enable_all_disable_all_enable_all() { - local TRACE_PATH=$(mktemp --tmpdir -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + local TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") SESSION_NAME="kernel_syscall_enable_all_disable_all_enable_all" diag "Syscall trace all events and enable/disable all" @@ -330,7 +330,7 @@ function test_syscall_enable_all_disable_all_enable_all() function test_syscall_enable_all_enable_one_disable_all() { - local TRACE_PATH=$(mktemp --tmpdir -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + local TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") SESSION_NAME="kernel_syscall_enable_all_enable_one_disable_all" diag "Syscall trace all events, enable one and disable all" @@ -359,7 +359,7 @@ function test_syscall_enable_all_enable_one_disable_all() function test_syscall_enable_one_enable_all_disable_one() { - local TRACE_PATH=$(mktemp --tmpdir -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + local TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") SESSION_NAME="kernel_syscall_enable_one_enable_all_disable_one" diag "Syscall trace all events and enable/disable one" @@ -388,7 +388,7 @@ function test_syscall_enable_one_enable_all_disable_one() function test_syscall_enable_one_enable_all_disable_all_disable_one() { - local TRACE_PATH=$(mktemp --tmpdir -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + local TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") SESSION_NAME="kernel_syscall_enable_one_enable_all_disable_all_disable_one" diag "Syscall trace all events and enable/disable one" @@ -420,7 +420,7 @@ function test_syscall_enable_one_enable_all_disable_all_disable_one() function test_syscall_enable_all_disable_all_twice() { - local TRACE_PATH=$(mktemp --tmpdir -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + local TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") SESSION_NAME="kernel_syscall_enable_all_disable_all_twice" diag "Syscall trace all events and enable/disable all twice" @@ -448,7 +448,7 @@ function test_syscall_enable_all_disable_all_twice() function test_syscall_enable_one_disable_one() { - local TRACE_PATH=$(mktemp --tmpdir -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + local TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") SESSION_NAME="kernel_syscall_enable_one_disable_one" diag "Syscall trace one event and disable one" @@ -472,7 +472,7 @@ function test_syscall_enable_one_disable_one() function test_syscall_enable_two_disable_two() { - local TRACE_PATH=$(mktemp --tmpdir -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + local TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") SESSION_NAME="kernel_syscall_enable_two_disable_two" diag "Syscall trace two events and disable two" @@ -498,7 +498,7 @@ function test_syscall_enable_two_disable_two() function test_syscall_enable_two_disable_one() { - local TRACE_PATH=$(mktemp --tmpdir -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + local TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") SESSION_NAME="kernel_syscall_enable_two_disable_one" diag "Syscall trace two events and disable one" @@ -527,7 +527,7 @@ function test_syscall_enable_two_disable_one() function test_syscall_disable_twice() { - local TRACE_PATH=$(mktemp --tmpdir -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + local TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") SESSION_NAME="kernel_syscall_disable_twice" diag "Syscall trace one event and disable twice" @@ -547,7 +547,7 @@ function test_syscall_disable_twice() function test_syscall_disable_all_twice() { - local TRACE_PATH=$(mktemp --tmpdir -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + local TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") SESSION_NAME="kernel_syscall_disable_all_twice" diag "Syscall trace all events and disable all twice" @@ -568,7 +568,7 @@ function test_syscall_disable_all_twice() function test_syscall_enable_unknown() { - local TRACE_PATH=$(mktemp --tmpdir -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + local TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") SESSION_NAME="kernel_syscall_enable_unknown" diag "Syscall enable an unknown event" @@ -586,7 +586,7 @@ function test_syscall_enable_unknown() function test_syscall_enable_all_enable_one() { - local TRACE_PATH=$(mktemp --tmpdir -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + local TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") SESSION_NAME="kernel_syscall_enable_all_enable_one" diag "Syscall enable all and enable one" @@ -604,7 +604,7 @@ function test_syscall_enable_all_enable_one() function test_syscall_disable_all_disable_one() { - local TRACE_PATH=$(mktemp --tmpdir -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + local TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") SESSION_NAME="kernel_syscall_enable_all_enable_one" diag "Syscall disable all and disable one" @@ -623,7 +623,7 @@ function test_syscall_disable_all_disable_one() function test_syscall_enable_channel_disable_all() { - local TRACE_PATH=$(mktemp --tmpdir -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + local TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") SESSION_NAME="kernel_syscall_enable_channel_disable_all" CHANNEL_NAME="channel" @@ -643,7 +643,7 @@ function test_syscall_enable_channel_disable_all() function test_syscall_enable_channel_disable_one() { - local TRACE_PATH=$(mktemp --tmpdir -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + local TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") SESSION_NAME="kernel_syscall_enable_channel_disable_all" CHANNEL_NAME="channel" diff --git a/tests/regression/kernel/test_userspace_probe b/tests/regression/kernel/test_userspace_probe index 1091ee65e..bfa260e47 100755 --- a/tests/regression/kernel/test_userspace_probe +++ b/tests/regression/kernel/test_userspace_probe @@ -44,7 +44,7 @@ function validate_list() function test_userspace_probe_enable_file_noexist () { - TRACE_PATH=$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") SESSION_NAME="test_userspace_probe_enable_file_noexist" ENABLE_EXPR="elf:/etc/file-not-exist:$ELF_SYMBOL" @@ -61,7 +61,7 @@ function test_userspace_probe_enable_file_noexist () function test_userspace_probe_enable_file_not_elf () { - TRACE_PATH=$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") SESSION_NAME="test_userspace_probe_enable_file_not_elf" ENABLE_EXPR="elf:/etc/passwd:$ELF_SYMBOL" @@ -78,7 +78,7 @@ function test_userspace_probe_enable_file_not_elf () function test_userspace_probe_enable_elf_missing_symbol_name () { - TRACE_PATH=$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") SESSION_NAME="test_userspace_probe_enable_elf_missing_symbol" ENABLE_EXPR="elf:$ELF_TEST_BIN:" @@ -95,7 +95,7 @@ function test_userspace_probe_enable_elf_missing_symbol_name () function test_userspace_probe_enable_elf_nonexistant_symbol () { - TRACE_PATH=$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") SESSION_NAME="test_userspace_probe_enable_elf_nonexistant_symbol" ELF_SYMBOL_NO_EXIST="function_doesnt_exist" ENABLE_EXPR="elf:$ELF_TEST_BIN:$ELF_SYMBOL_NO_EXIST" @@ -113,7 +113,7 @@ function test_userspace_probe_enable_elf_nonexistant_symbol () function test_userspace_probe_enable_elf_symbol_not_function () { - TRACE_PATH=$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") SESSION_NAME="test_userspace_probe_enable_elf_symbol_not_function" ELF_SYMBOL_NO_FUNC="not_a_function" ENABLE_EXPR="elf:$ELF_TEST_BIN:$ELF_SYMBOL_NO_FUNC" @@ -131,7 +131,7 @@ function test_userspace_probe_enable_elf_symbol_not_function () function test_userspace_probe_unsupported_types () { - TRACE_PATH=$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") SESSION_NAME="test_userspace_probe_unsupported_types" # Userspace probe at an address or at an offset to a function # instrumentation description types are not supported at the moment. @@ -156,7 +156,7 @@ function test_userspace_probe_unsupported_types () function test_userspace_probe_enable_implicit_probe_type () { - TRACE_PATH=$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") SESSION_NAME="test_userspace_probe_enable_implicit_probe_type" ENABLE_EXPR="$ELF_TEST_BIN:$ELF_SYMBOL" @@ -178,7 +178,7 @@ function test_userspace_probe_enable_implicit_probe_type () function test_userspace_probe_enable_elf_symbol_exists () { - TRACE_PATH=$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") SESSION_NAME="test_userspace_probe_enable_elf_symbol_exists" ENABLE_EXPR="elf:$ELF_TEST_BIN:$ELF_SYMBOL" @@ -200,7 +200,7 @@ function test_userspace_probe_enable_elf_symbol_exists () function test_userspace_probe_enable_in_path () { - TRACE_PATH=$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") SESSION_NAME="test_userspace_probe_enable_in_path" ENABLE_EXPR="elf:$ELF_TEST_BIN_NAME:$ELF_SYMBOL" @@ -229,7 +229,7 @@ function test_userspace_probe_enable_in_path () function test_userspace_probe_enable_full_path () { - TRACE_PATH=$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") SESSION_NAME="test_userspace_probe_enable_full_path" ENABLE_EXPR="elf:$(realpath $ELF_TEST_BIN):$ELF_SYMBOL" diag "Userspace probe with full path enabled successfully" @@ -250,9 +250,9 @@ function test_userspace_probe_enable_full_path () function test_userspace_probe_enable_colon_in_path () { - TRACE_PATH=$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") SESSION_NAME="test_userspace_probe_enable_colon_in_path" - COLON_FILE_PATH=$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + COLON_FILE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") ELF_BIN_SYMLINK="$COLON_FILE_PATH/colon_:_in_name" ELF_BIN_WITH_COLON_IN_NAME_ESCAPED="$COLON_FILE_PATH/colon_\:_in_name" ENABLE_EXPR="elf:"$ELF_BIN_WITH_COLON_IN_NAME_ESCAPED":$ELF_SYMBOL" @@ -278,7 +278,7 @@ function test_userspace_probe_enable_colon_in_path () function test_userspace_probe_elf () { - TRACE_PATH=$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") SESSION_NAME="test_userprobe_elf" ENABLE_EXPR="elf:$ELF_TEST_BIN:$ELF_SYMBOL" @@ -301,7 +301,7 @@ function test_userspace_probe_elf () function test_userspace_probe_elf_dynamic_symbol () { - TRACE_PATH=$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") SESSION_NAME="test_userprobe_elf" LIBFOO_PATH="$ELF_TEST_BIN_DIR/libfoo.so" ENABLE_EXPR="elf:$LIBFOO_PATH:dynamic_symbol" @@ -325,7 +325,7 @@ function test_userspace_probe_elf_dynamic_symbol () function test_userspace_probe_elf_cxx_function () { - TRACE_PATH=$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") SESSION_NAME="test_userprobe_elf_cxx_function" # Probing C++ mangled symbols should work the same way as regular Elf # symbols @@ -351,7 +351,7 @@ function test_userspace_probe_elf_cxx_function () function test_userspace_probe_elf_cxx_method () { - TRACE_PATH=$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") SESSION_NAME="test_userprobe_elf_cxx_method" # Probing C++ mangled symbols should work the same way as regular Elf # symbols @@ -377,7 +377,7 @@ function test_userspace_probe_elf_cxx_method () function test_userspace_probe_elf_disable () { - TRACE_PATH=$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") SESSION_NAME="test_userprobe_elf_disable" ENABLE_EXPR="elf:$ELF_TEST_BIN:$ELF_SYMBOL" @@ -403,7 +403,7 @@ function test_userspace_probe_elf_disable () function test_userspace_probe_elf_list () { - TRACE_PATH=$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") SESSION_NAME="test_userprobe_elf_list" ENABLE_EXPR="elf:$ELF_TEST_BIN:$ELF_SYMBOL" @@ -431,9 +431,9 @@ function test_userspace_probe_save_load_elf() # saves the path to the link and not to the actual file. This is to # support instrumentation of shared objects that are often accessed # through symlinks and updated. - TRACE_PATH=$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") - TMP_LINK_DIR=$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") - TMP_SAVE_DIR=$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + TMP_LINK_DIR=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + TMP_SAVE_DIR=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") SESSION_NAME="test_userprobe_save_load_elf" @@ -487,9 +487,9 @@ function test_userspace_probe_save_load_sdt() # saves the path to the link and not to the actual file. This is to # support instrumentation of shared objects that are often accessed # through symlinks and updated. - TRACE_PATH=$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") - TMP_LINK_DIR=$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") - TMP_SAVE_DIR=$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + TMP_LINK_DIR=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + TMP_SAVE_DIR=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") SESSION_NAME="test_userprobe_save_load_sdt" PROVIDER="foobar" @@ -541,7 +541,7 @@ function test_userspace_probe_save_load_sdt() function test_userspace_probe_sdt () { - TRACE_PATH=$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") PROVIDER="foobar" PROBE="tp1" ENABLE_EXPR="sdt:$SDT_TEST_BIN:$PROVIDER:$PROBE" @@ -566,7 +566,7 @@ function test_userspace_probe_sdt () function test_userspace_probe_sdt_list () { - TRACE_PATH=$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") SESSION_NAME="test_userprobe_sdt_list" PROVIDER="foobar" PROBE="tp1" @@ -592,7 +592,7 @@ function test_userspace_probe_sdt_list () function test_userspace_probe_enable_sdt_nonexistant_provider () { - TRACE_PATH=$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") SESSION_NAME="test_userprobe_sdt_nonexistand_provider" PROVIDER="not_provider" PROBE="tp1" @@ -611,7 +611,7 @@ function test_userspace_probe_enable_sdt_nonexistant_provider () function test_userspace_probe_enable_sdt_nonexistant_probe () { - TRACE_PATH=$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") SESSION_NAME="test_userprobe_sdt_nonexistant_probe" PROVIDER="foobar" PROBE="not_a_tracepoint" @@ -630,7 +630,7 @@ function test_userspace_probe_enable_sdt_nonexistant_probe () function test_userspace_probe_enable_sdt_with_sema () { - TRACE_PATH=$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") SESSION_NAME="test_userprobe_sdt_with_sema" PROVIDER="foobar" PROBE="tp_with_semaphore" @@ -649,7 +649,7 @@ function test_userspace_probe_enable_sdt_with_sema () function test_userspace_probe_sdt_one_probe () { - TRACE_PATH=$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") SESSION_NAME="test_userprobe_sdt_one_probe" PROVIDER="foobar" PROBE="tp1" @@ -674,7 +674,7 @@ function test_userspace_probe_sdt_one_probe () function test_userspace_probe_sdt_two_probes () { - TRACE_PATH=$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") SESSION_NAME="test_userprobe_sdt_two_probes" PROVIDER="foobar" PROBE="tp2" @@ -699,7 +699,7 @@ function test_userspace_probe_sdt_two_probes () function test_userspace_probe_sdt_in_shared_object () { - TRACE_PATH=$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") SESSION_NAME="test_userprobe_sdt_shared_object" PROVIDER="foobar" PROBE="tp_in_shared_object" @@ -724,7 +724,7 @@ function test_userspace_probe_sdt_in_shared_object () function test_userspace_probe_sdt_in_shared_object_dlopen () { - TRACE_PATH=$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") SESSION_NAME="test_userprobe_sdt_shared_object_dlopen" PROVIDER="foobar" PROBE="tp_in_dlopen" @@ -749,7 +749,7 @@ function test_userspace_probe_sdt_in_shared_object_dlopen () function test_userspace_probe_sdt_in_shared_object_ldpreload () { - TRACE_PATH=$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") SESSION_NAME="test_userprobe_sdt_shared_object_ldpreload" PROVIDER="foobar" PROBE="tp_in_ldpreload" @@ -774,7 +774,7 @@ function test_userspace_probe_sdt_in_shared_object_ldpreload () function test_userspace_probe_sdt_with_arg () { - TRACE_PATH=$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") SESSION_NAME="test_userprobe_sdt_arg" PROVIDER="foobar" PROBE="tp_with_arg" diff --git a/tests/regression/tools/base-path/test_ust b/tests/regression/tools/base-path/test_ust index 38a087753..c7f03b59b 100755 --- a/tests/regression/tools/base-path/test_ust +++ b/tests/regression/tools/base-path/test_ust @@ -13,7 +13,7 @@ TESTAPP_NAME="gen-ust-events" TESTAPP_BIN="$TESTAPP_PATH/$TESTAPP_NAME/$TESTAPP_NAME" EVENT_NAME="tp:tptest" -TRACE_PATH=$(mktemp --tmpdir -d tmp.test_base_path_ust_trace_path.XXXXXX) +TRACE_PATH=$(mktemp -d -t tmp.test_base_path_ust_trace_path.XXXXXX) NUM_TESTS=42 diff --git a/tests/regression/tools/channel/test_channel b/tests/regression/tools/channel/test_channel index 7244ac3c7..a530b649d 100755 --- a/tests/regression/tools/channel/test_channel +++ b/tests/regression/tools/channel/test_channel @@ -19,7 +19,7 @@ source $TESTDIR/utils/utils.sh function test_channel_disable_stopped_session() { - local TRACE_PATH=$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + local TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") local SESSION_NAME="test_channel" local CHAN_NAME="channel0" local EVENT_NAME="tp:tptest" diff --git a/tests/regression/tools/clear/test_kernel b/tests/regression/tools/clear/test_kernel index 0229f5f92..0d27ec6c9 100755 --- a/tests/regression/tools/clear/test_kernel +++ b/tests/regression/tools/clear/test_kernel @@ -11,7 +11,7 @@ TESTDIR=$CURDIR/../../.. EVENT_NAME="lttng_test_filter_event" PAGE_SIZE=$(getconf PAGE_SIZE) -TRACE_PATH=$(mktemp --tmpdir -d tmp.test_clear_kernel_trace_path.XXXXXX) +TRACE_PATH=$(mktemp -d -t tmp.test_clear_kernel_trace_path.XXXXXX) NUM_TESTS=837 @@ -200,8 +200,8 @@ function test_kernel_basic_streaming_live_viewer () local local_path="${TRACE_PATH}/${HOSTNAME}/${SESSION_NAME}*" local remote_trace_path="${HOSTNAME}/${SESSION_NAME}" local channel_name="chan" - local bt_output_path=$(mktemp --tmpdir -t "tmp.${FUNCNAME[0]}_bt_output.XXXXXX") - local file_sync_before_exit=$(mktemp --tmpdir -u -t "tmp.${FUNCNAME[0]}_sync_before_exit.XXXXXX") + local bt_output_path=$(mktemp -t "tmp.${FUNCNAME[0]}_bt_output.XXXXXX") + local file_sync_before_exit=$(mktemp -u -t "tmp.${FUNCNAME[0]}_sync_before_exit.XXXXXX") diag "Test kernel basic streaming live with viewer" diag "Parameters: tracing_active=$tracing_active, clear_twice=$clear_twice" @@ -247,7 +247,7 @@ function test_kernel_streaming_live_viewer () local local_path="${TRACE_PATH}/${HOSTNAME}/${SESSION_NAME}*" local remote_trace_path="${HOSTNAME}/${SESSION_NAME}" local channel_name="chan" - local bt_output_path=$(mktemp --tmpdir -t "tmp.${FUNCNAME[0]}_bt_output.XXXXXX") + local bt_output_path=$(mktemp -t "tmp.${FUNCNAME[0]}_bt_output.XXXXXX") diag "Test kernel streaming live clear with viewer" diag "Parameters: tracing_active=$tracing_active, clear_twice=$clear_twice" diff --git a/tests/regression/tools/clear/test_ust b/tests/regression/tools/clear/test_ust index 27cd71fe9..fadf0e952 100755 --- a/tests/regression/tools/clear/test_ust +++ b/tests/regression/tools/clear/test_ust @@ -19,7 +19,7 @@ TESTAPP_BIN="$TESTAPP_PATH/$TESTAPP_NAME/$TESTAPP_NAME" NUM_TESTS=2071 PAGE_SIZE=$(getconf PAGE_SIZE) -TRACE_PATH=$(mktemp --tmpdir -d tmp.test_clear_ust_trace_path.XXXXXX) +TRACE_PATH=$(mktemp -d -t tmp.test_clear_ust_trace_path.XXXXXX) source $TESTDIR/utils/utils.sh @@ -244,8 +244,8 @@ function test_ust_basic_streaming_live_viewer () local local_path="${TRACE_PATH}/${HOSTNAME}/${SESSION_NAME}*" local remote_trace_path="${HOSTNAME}/${SESSION_NAME}" local channel_name="chan" - local bt_output_path=$(mktemp --tmpdir -u tmp.test_${FUNCNAME[0]}_bt_output_path.XXXXXX) - local file_sync_before_exit=$(mktemp --tmpdir -u tmp.test_${FUNCNAME[0]}_sync_before_exit.XXXXXX) + local bt_output_path=$(mktemp -u -t tmp.test_${FUNCNAME[0]}_bt_output_path.XXXXXX) + local file_sync_before_exit=$(mktemp -u -t tmp.test_${FUNCNAME[0]}_sync_before_exit.XXXXXX) diag "Test ust basic streaming live with viewer" diag "Parameters: tracing_active=$tracing_active, clear_twice=$clear_twice, buffer_type=$buffer_type" @@ -296,7 +296,7 @@ function test_ust_streaming_live_viewer () local local_path="${TRACE_PATH}/${HOSTNAME}/${SESSION_NAME}*" local remote_trace_path="${HOSTNAME}/${SESSION_NAME}" local channel_name="chan" - local bt_output_path=$(mktemp --tmpdir -u tmp.test_${FUNCNAME[0]}_bt_output_path.XXXXXX) + local bt_output_path=$(mktemp -u -t tmp.test_${FUNCNAME[0]}_bt_output_path.XXXXXX) diag "Test ust streaming live clear with viewer" diag "Parameters: tracing_active=$tracing_active, clear_twice=$clear_twice, buffer_type=$buffer_type" @@ -336,9 +336,9 @@ function test_ust_streaming_live_viewer_new_metadata_after_clear () local remote_trace_path="${HOSTNAME}/${SESSION_NAME}" local channel_name="chan" - local bt_output_path=$(mktemp --tmpdir -t "tmp.${FUNCNAME[0]}_bt_output.XXXXXX") - local bt_error_path=$(mktemp --tmpdir -t "tmp.${FUNCNAME[0]}_bt_error.XXXXXX") - local file_sync_before_exit=$(mktemp --tmpdir -u -t "tmp.${FUNCNAME[0]}_sync_before_exit.XXXXXX") + local bt_output_path=$(mktemp -t "tmp.${FUNCNAME[0]}_bt_output.XXXXXX") + local bt_error_path=$(mktemp -t "tmp.${FUNCNAME[0]}_bt_error.XXXXXX") + local file_sync_before_exit=$(mktemp -u -t "tmp.${FUNCNAME[0]}_sync_before_exit.XXXXXX") diag "Test ust streaming live clear with viewer with new metadata after clear" diag "Parameters: tracing_active=$tracing_active, clear_twice=$clear_twice, buffer_type=$buffer_type" @@ -617,10 +617,10 @@ function test_ust_local_snapshot_per_pid () # 3, 4 unused. local buffer_type=$5 local channel_name="channel0" - local file_sync_before_last=$(mktemp --tmpdir -u "tmp.${FUNCNAME[0]}_sync_before_last.XXXXXX") - local file_sync_before_last_touch=$(mktemp --tmpdir -u "tmp.${FUNCNAME[0]}_sync_before_last_touch.XXXXXX") - local file_sync_before_exit=$(mktemp --tmpdir -u "tmp.${FUNCNAME[0]}_sync_before_exit.XXXXXX") - local file_sync_before_exit_touch=$(mktemp --tmpdir -u -t "tmp.${FUNCNAME[0]}_sync_before_exit_touch.XXXXXX") + local file_sync_before_last=$(mktemp -u -t "tmp.${FUNCNAME[0]}_sync_before_last.XXXXXX") + local file_sync_before_last_touch=$(mktemp -u -t "tmp.${FUNCNAME[0]}_sync_before_last_touch.XXXXXX") + local file_sync_before_exit=$(mktemp -u -t "tmp.${FUNCNAME[0]}_sync_before_exit.XXXXXX") + local file_sync_before_exit_touch=$(mktemp -u -t "tmp.${FUNCNAME[0]}_sync_before_exit_touch.XXXXXX") diag "Test ust local snapshot clear per pid" diag "Parameters: tracing_active=$tracing_active, clear_twice=$clear_twice, buffer_type=$buffer_type" diff --git a/tests/regression/tools/crash/test_crash b/tests/regression/tools/crash/test_crash index 7570ba9b9..3fa9dbe95 100755 --- a/tests/regression/tools/crash/test_crash +++ b/tests/regression/tools/crash/test_crash @@ -19,7 +19,7 @@ NR_USEC_WAIT=0 NR_ITER=-1 # Temp file output -OUTPUT_DIR=$(mktemp -d --tmpdir tmp.test_crash_shm.XXXXXX) +OUTPUT_DIR=$(mktemp -d -t tmp.test_crash_shm.XXXXXX) LAST_APP_PID= @@ -39,7 +39,7 @@ bail_out_if_no_babeltrace function start_test_app() { - local tmp_file=$(mktemp --tmpdir -u "tmp.${FUNCNAME[0]}.XXXXXX") + local tmp_file=$(mktemp -u -t "tmp.${FUNCNAME[0]}.XXXXXX") # Start application with a temporary file. $TESTAPP_BIN -i $NR_ITER -w $NR_USEC_WAIT --sync-after-first-event $tmp_file & @@ -95,7 +95,7 @@ function test_shm_path_per_pid() diag "Shm: ust per-pid test" local session_name=shm_path_per_pid local channel_name=channel_per_pid - local shm_path=$(mktemp -d --tmpdir "tmp.${FUNCNAME[0]}_shm.XXXXXX") + local shm_path=$(mktemp -d -t "tmp.${FUNCNAME[0]}_shm.XXXXXX") # Build up start_lttng_sessiond @@ -166,7 +166,7 @@ function test_shm_path_per_uid() local session_name=shm_path_per_uid local channel_name=channel_per_uid set -x - local shm_path=$(mktemp -d --tmpdir "tmp.${FUNCNAME[0]}_shm_path.XXXXXX") + local shm_path=$(mktemp -d -t "tmp.${FUNCNAME[0]}_shm_path.XXXXXX") set +x # Build up @@ -218,8 +218,8 @@ function test_lttng_crash() diag "Lttng-crash: basic recuperation" local session_name=crash_test local channel_name=channel_crash - local shm_path=$(mktemp -d --tmpdir "tmp.${FUNCNAME[0]}_shm_path.XXXXXX") - local shm_path_symlink=$(mktemp -d --tmpdir "tmp.${FUNCNAME[0]}_shm_path_symlink.XXXXXX") + local shm_path=$(mktemp -d -t "tmp.${FUNCNAME[0]}_shm_path.XXXXXX") + local shm_path_symlink=$(mktemp -d -t "tmp.${FUNCNAME[0]}_shm_path_symlink.XXXXXX") local event_name="tp:tptest" # Create a session in snapshot mode to deactivate any use of consumerd @@ -255,8 +255,8 @@ function test_lttng_crash_extraction() diag "Lttng-crash: extraction to path" local session_name=crash_test local channel_name=channel_crash - local shm_path=$(mktemp -d --tmpdir "tmp.${FUNCNAME[0]}_shm_path.XXXXXX") - local extraction_dir_path=$(mktemp -d --tmpdir "tmp.${FUNCNAME[0]}_extraction_dir_path.XXXXXX") + local shm_path=$(mktemp -d -t "tmp.${FUNCNAME[0]}_shm_path.XXXXXX") + local extraction_dir_path=$(mktemp -d -t "tmp.${FUNCNAME[0]}_extraction_dir_path.XXXXXX") local extraction_path=$extraction_dir_path/extract local event_name="tp:tptest" @@ -289,7 +289,7 @@ function test_shm_path_per_pid_sigint() diag "Shm: ust per-pid test sigint" local session_name=shm_path_per_pid local channel_name=channel_per_pid - local shm_path=$(mktemp -d --tmpdir "tmp.${FUNCNAME[0]}_shm_path.XXXXXX") + local shm_path=$(mktemp -d -t "tmp.${FUNCNAME[0]}_shm_path.XXXXXX") local num_files=0 # Build up @@ -320,7 +320,7 @@ function test_shm_path_per_uid_sigint() diag "Shm: ust per-uid test sigint" local session_name=shm_path_per_uid_sigint local channel_name=channel_per_uid_sigint - local shm_path=$(mktemp -d --tmpdir "tmp.${FUNCNAME[0]}_shm_path.XXXXXX") + local shm_path=$(mktemp -d -t "tmp.${FUNCNAME[0]}_shm_path.XXXXXX") local ret=0 # Build up @@ -351,8 +351,8 @@ function test_lttng_crash_extraction_sigkill() diag "Lttng-crash: extraction with sigkill" local session_name=crash_test local channel_name=channel_crash - local shm_path=$(mktemp -d --tmpdir "tmp.${FUNCNAME[0]}_shm_path.XXXXXX") - local extraction_dir_path=$(mktemp -d --tmpdir "tmp.${FUNCNAME[0]}_extraction_dir_path.XXXXXX") + local shm_path=$(mktemp -d -t "tmp.${FUNCNAME[0]}_shm_path.XXXXXX") + local extraction_dir_path=$(mktemp -d -t "tmp.${FUNCNAME[0]}_extraction_dir_path.XXXXXX") local extraction_path=$extraction_dir_path/extract local event_name="tp:tptest" local ret=0 diff --git a/tests/regression/tools/exclusion/test_exclusion b/tests/regression/tools/exclusion/test_exclusion index 0c9bdc829..47deede06 100755 --- a/tests/regression/tools/exclusion/test_exclusion +++ b/tests/regression/tools/exclusion/test_exclusion @@ -40,7 +40,7 @@ function run_apps # of our test suite to generate events. function dry_run { - local trace_path=$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + local trace_path=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") # Create session create_lttng_session_ok $SESSION_NAME $trace_path @@ -70,7 +70,7 @@ function test_exclusion { local exclusions="$1" local event_name_expected_to_be_missing="$2" - local trace_path=$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + local trace_path=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") # Create session create_lttng_session_ok $SESSION_NAME $trace_path @@ -99,9 +99,9 @@ function test_exclusion_tracing_started { local exclusions="$1" local event_name_expected_to_be_missing="$2" - local trace_path=$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") - local file_wait_before_first=$(mktemp --tmpdir -u "tmp.${FUNCNAME[0]}_sync_before_first.XXXXXX") - local file_create_in_main=$(mktemp --tmpdir -u "tmp.${FUNCNAME[0]}_sync_create_in_main.XXXXXX") + local trace_path=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + local file_wait_before_first=$(mktemp -u -t "tmp.${FUNCNAME[0]}_sync_before_first.XXXXXX") + local file_create_in_main=$(mktemp -u -t "tmp.${FUNCNAME[0]}_sync_create_in_main.XXXXXX") # Create session create_lttng_session_ok $SESSION_NAME $trace_path diff --git a/tests/regression/tools/filtering/test_invalid_filter b/tests/regression/tools/filtering/test_invalid_filter index 013061239..8dfbe9eb5 100755 --- a/tests/regression/tools/filtering/test_invalid_filter +++ b/tests/regression/tools/filtering/test_invalid_filter @@ -24,7 +24,7 @@ TESTDIR=$CURDIR/../../.. SESSION_NAME="filter-invalid" EVENT_NAME="bogus" ENABLE_EVENT_STDERR="/tmp/invalid-filters-stderr" -TRACE_PATH=$(mktemp --tmpdir -d tmp.test_filtering_invalid_filters_trace_path.XXXXXX) +TRACE_PATH=$(mktemp -d -t tmp.test_filtering_invalid_filters_trace_path.XXXXXX) NUM_GLOBAL_TESTS=2 NUM_UST_TESTS=138 NUM_KERNEL_TESTS=138 diff --git a/tests/regression/tools/filtering/test_unsupported_op b/tests/regression/tools/filtering/test_unsupported_op index 299247a3c..dc76f99a6 100755 --- a/tests/regression/tools/filtering/test_unsupported_op +++ b/tests/regression/tools/filtering/test_unsupported_op @@ -12,7 +12,7 @@ TESTDIR=$CURDIR/../../.. SESSION_NAME="filter-unsupported-ops" EVENT_NAME="bogus" ENABLE_EVENT_STDERR="/tmp/unsupported-ops-enable" -TRACE_PATH=$(mktemp --tmpdir -d tmp.test_filtering_unsupported_ops_trace_path.XXXXXX) +TRACE_PATH=$(mktemp -d -t tmp.test_filtering_unsupported_ops_trace_path.XXXXXX) NUM_GLOBAL_TESTS=2 NUM_UST_TESTS=20 NUM_KERNEL_TESTS=20 diff --git a/tests/regression/tools/filtering/test_valid_filter b/tests/regression/tools/filtering/test_valid_filter index 7e764ca5d..e8401c591 100755 --- a/tests/regression/tools/filtering/test_valid_filter +++ b/tests/regression/tools/filtering/test_valid_filter @@ -94,7 +94,7 @@ function test_valid_filter event_name="$3" filter="$4" validator="$5" - local trace_path=$(mktemp --tmpdir -d tmp.test_filtering_invalid_filters_trace_path.XXXXXX) + local trace_path=$(mktemp -d -t tmp.test_filtering_invalid_filters_trace_path.XXXXXX) diag "Test valid $domain_name filter: $filter" diff --git a/tests/regression/tools/health/test_health.sh b/tests/regression/tools/health/test_health.sh index 01da978a9..b4b416f92 100644 --- a/tests/regression/tools/health/test_health.sh +++ b/tests/regression/tools/health/test_health.sh @@ -266,10 +266,10 @@ TEST_RELAYD=( 1 ) -STDOUT_PATH=$(mktemp --tmpdir tmp.test_health_stdout_path.XXXXXX) -STDERR_PATH=$(mktemp --tmpdir tmp.test_health_stderr_path.XXXXXX) -TRACE_PATH=$(mktemp --tmpdir -d tmp.test_health_trace_path.XXXXXX) -HEALTH_PATH=$(mktemp --tmpdir -d tmp.test_health_trace_path.XXXXXX) +STDOUT_PATH=$(mktemp -t tmp.test_health_stdout_path.XXXXXX) +STDERR_PATH=$(mktemp -t tmp.test_health_stderr_path.XXXXXX) +TRACE_PATH=$(mktemp -d -t tmp.test_health_trace_path.XXXXXX) +HEALTH_PATH=$(mktemp -d -t tmp.test_health_trace_path.XXXXXX) if [ "$(id -u)" == "0" ]; then isroot=1 diff --git a/tests/regression/tools/health/test_thread_ok b/tests/regression/tools/health/test_thread_ok index e84adb611..663b7e4cb 100755 --- a/tests/regression/tools/health/test_thread_ok +++ b/tests/regression/tools/health/test_thread_ok @@ -110,10 +110,10 @@ plan_tests $NUM_TESTS print_test_banner "$TEST_DESC" -STDOUT_PATH=$(mktemp --tmpdir tmp.test_thread_ok_stdout_path.XXXXXX) -STDERR_PATH=$(mktemp --tmpdir tmp.test_thread_ok_stderr_path.XXXXXX) -TRACE_PATH=$(mktemp --tmpdir -d tmp.test_thread_ok_trace_path.XXXXXX) -HEALTH_PATH=$(mktemp --tmpdir -d tmp.test_thread_ok_trace_path.XXXXXX) +STDOUT_PATH=$(mktemp -t tmp.test_thread_ok_stdout_path.XXXXXX) +STDERR_PATH=$(mktemp -t tmp.test_thread_ok_stderr_path.XXXXXX) +TRACE_PATH=$(mktemp -d -t tmp.test_thread_ok_trace_path.XXXXXX) +HEALTH_PATH=$(mktemp -d -t tmp.test_thread_ok_trace_path.XXXXXX) # The manage kernel thread is only spawned if we are root if [ "$(id -u)" == "0" ]; then diff --git a/tests/regression/tools/live/test_kernel b/tests/regression/tools/live/test_kernel index b622b5214..1be703aac 100755 --- a/tests/regression/tools/live/test_kernel +++ b/tests/regression/tools/live/test_kernel @@ -16,7 +16,7 @@ DELAY_USEC=2000000 SESSION_NAME="live" EVENT_NAME="lttng_test_filter_event" -TRACE_PATH=$(mktemp --tmpdir -d tmp.test_live_kernel_trace_path.XXXXXX) +TRACE_PATH=$(mktemp -d -t tmp.test_live_kernel_trace_path.XXXXXX) DIR=$(readlink -f $TESTDIR) diff --git a/tests/regression/tools/live/test_lttng_kernel b/tests/regression/tools/live/test_lttng_kernel index a23d9373a..ae8c57e6b 100755 --- a/tests/regression/tools/live/test_lttng_kernel +++ b/tests/regression/tools/live/test_lttng_kernel @@ -14,7 +14,7 @@ DELAY_USEC=2000000 SESSION_NAME="live" EVENT_NAME="lttng_test_filter_event" -TRACE_PATH=$(mktemp --tmpdir -d tmp.test_lttng_live_kernel_trace_path.XXXXXX) +TRACE_PATH=$(mktemp -d -t tmp.test_lttng_live_kernel_trace_path.XXXXXX) DIR=$(readlink -f $TESTDIR) diff --git a/tests/regression/tools/live/test_lttng_ust b/tests/regression/tools/live/test_lttng_ust index 3aa1083b0..133564416 100755 --- a/tests/regression/tools/live/test_lttng_ust +++ b/tests/regression/tools/live/test_lttng_ust @@ -19,7 +19,7 @@ TESTAPP_BIN="$TESTAPP_PATH/$TESTAPP_NAME/$TESTAPP_NAME" SESSION_NAME="live" EVENT_NAME="tp:tptest" -TRACE_PATH=$(mktemp --tmpdir -d tmp.test_test_live_lttng_ust_trace_path.XXXXXX) +TRACE_PATH=$(mktemp -d -t tmp.test_test_live_lttng_ust_trace_path.XXXXXX) DIR=$(readlink -f $TESTDIR) diff --git a/tests/regression/tools/live/test_ust b/tests/regression/tools/live/test_ust index 45761c5c9..d901421c7 100755 --- a/tests/regression/tools/live/test_ust +++ b/tests/regression/tools/live/test_ust @@ -19,7 +19,7 @@ TESTAPP_BIN="$TESTAPP_PATH/$TESTAPP_NAME/$TESTAPP_NAME" SESSION_NAME="live" EVENT_NAME="tp:tptest" -TRACE_PATH=$(mktemp --tmpdir -d tmp.test_live_ust_trace_path.XXXXXX) +TRACE_PATH=$(mktemp -d -t tmp.test_live_ust_trace_path.XXXXXX) DIR=$(readlink -f $TESTDIR) @@ -44,7 +44,7 @@ function clean_live_tracing() rm -rf $TRACE_PATH } -file_sync_after_first=$(mktemp --tmpdir -u tmp.test_live_ust_sync_after_first.XXXXXX) +file_sync_after_first=$(mktemp -u -t tmp.test_live_ust_sync_after_first.XXXXXX) start_lttng_sessiond_notap start_lttng_relayd_notap "-o $TRACE_PATH" diff --git a/tests/regression/tools/live/test_ust_tracefile_count b/tests/regression/tools/live/test_ust_tracefile_count index d576f3506..3225b65d6 100755 --- a/tests/regression/tools/live/test_ust_tracefile_count +++ b/tests/regression/tools/live/test_ust_tracefile_count @@ -19,7 +19,7 @@ TESTAPP_BIN="$TESTAPP_PATH/$TESTAPP_NAME/$TESTAPP_NAME" SESSION_NAME="live" EVENT_NAME="tp:tptest" -TRACE_PATH=$(mktemp --tmpdir -d tmp.test_ust_trace_file_count_trace_path.XXXXXX) +TRACE_PATH=$(mktemp -d -t tmp.test_ust_trace_file_count_trace_path.XXXXXX) DIR=$(readlink -f $TESTDIR) @@ -45,7 +45,7 @@ function clean_live_tracing() rm -rf $TRACE_PATH } -file_sync_after_first=$(mktemp --tmpdir -u tmp.test_ust_trace_file_count_sync_after_first.XXXXXX) +file_sync_after_first=$(mktemp -u -t tmp.test_ust_trace_file_count_sync_after_first.XXXXXX) start_lttng_sessiond_notap start_lttng_relayd_notap "-o $TRACE_PATH" diff --git a/tests/regression/tools/metadata/test_kernel b/tests/regression/tools/metadata/test_kernel index 08743008b..e7b9a95a7 100755 --- a/tests/regression/tools/metadata/test_kernel +++ b/tests/regression/tools/metadata/test_kernel @@ -10,7 +10,7 @@ CURDIR=$(dirname "$0")/ TESTDIR=$CURDIR/../../.. EVENT_NAME="lttng_test_filter_event" -TRACE_PATH=$(mktemp --tmpdir -d tmp.test_metadata_env_kernel_trace_path.XXXXXX) +TRACE_PATH=$(mktemp -d -t tmp.test_metadata_env_kernel_trace_path.XXXXXX) NUM_TESTS=13 @@ -26,8 +26,8 @@ function test_kernel () local expected_path="${TRACE_PATH}/lttng-traces" local session_name="kernel" - local metadata=$(mktemp --tmpdir "tmp.${FUNCNAME[0]}_metadata.XXXXXX") - local metadata_env=$(mktemp --tmpdir "tmp.${FUNCNAME[0]}_metadata_env.XXXXXX") + local metadata=$(mktemp -t "tmp.${FUNCNAME[0]}_metadata.XXXXXX") + local metadata_env=$(mktemp -t "tmp.${FUNCNAME[0]}_metadata_env.XXXXXX") diag "Test Kernel metadata env field" create_lttng_session_ok "$session_name" diff --git a/tests/regression/tools/metadata/test_ust b/tests/regression/tools/metadata/test_ust index 6b17b02cf..fc9aea536 100755 --- a/tests/regression/tools/metadata/test_ust +++ b/tests/regression/tools/metadata/test_ust @@ -13,7 +13,7 @@ TESTAPP_NAME="gen-ust-events" TESTAPP_BIN="$TESTAPP_PATH/$TESTAPP_NAME/$TESTAPP_NAME" EVENT_NAME="tp:tptest" -TRACE_PATH=$(mktemp --tmpdir -d tmp.test_metadata_env_ust_trace_path.XXXXXX) +TRACE_PATH=$(mktemp -d -t tmp.test_metadata_env_ust_trace_path.XXXXXX) NUM_TESTS=37 @@ -37,8 +37,8 @@ function test_per_uid () local expected_path="${TRACE_PATH}/lttng-traces" local session_name="per-uid" - local metadata=$(mktemp --tmpdir tmp.test_${FUNCNAME[0]}_metadata.XXXXXX) - local metadata_env=$(mktemp --tmpdir tmp.test_${FUNCNAME[0]}_metadata_env.XXXXXX) + local metadata=$(mktemp -t tmp.test_${FUNCNAME[0]}_metadata.XXXXXX) + local metadata_env=$(mktemp -t tmp.test_${FUNCNAME[0]}_metadata_env.XXXXXX) diag "Test UST metadata env field in per-uid mode" create_lttng_session_ok "$session_name" @@ -125,8 +125,8 @@ function test_per_pid () local expected_path="${TRACE_PATH}/lttng-traces" local session_name="per-pid" - local metadata=$(mktemp --tmpdir tmp.test_${FUNCNAME[0]}_metadata.XXXXXX) - local metadata_env=$(mktemp --tmpdir tmp.test_${FUNCNAME[0]}_metadata_env.XXXXXX) + local metadata=$(mktemp -t tmp.test_${FUNCNAME[0]}_metadata.XXXXXX) + local metadata_env=$(mktemp -t tmp.test_${FUNCNAME[0]}_metadata_env.XXXXXX) diag "Test UST metadata env field in per-pid mode" create_lttng_session_ok "$session_name" diff --git a/tests/regression/tools/mi/test_mi b/tests/regression/tools/mi/test_mi index bd0c59b85..2c469f108 100755 --- a/tests/regression/tools/mi/test_mi +++ b/tests/regression/tools/mi/test_mi @@ -17,8 +17,8 @@ NR_USEC_WAIT=0 NR_ITER=10000 #Temp file output -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_DIR=$(mktemp -d -t tmp.test_mi_output_dir.XXXXXX) +SESSIOND_LOAD_DIR=$(mktemp -d -t tmp.test_mi_sessiond_load_dir.XXXXXX) OUTPUT_FILE="default.xml" XPATH_CMD_OUTPUT="//lttng:command/lttng:output" @@ -536,8 +536,8 @@ function test_list_ust_event () { diag "Test list ust event" - 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") + local file_sync_after_first=$(mktemp -u -t "tmp.${FUNCNAME[0]}_sync_after_first.XXXXXX") + local file_sync_before_last=$(mktemp -u -t "tmp.${FUNCNAME[0]}_sync_before_last.XXXXXX") OUTPUT_FILE="list_ust_event.xml" diff --git a/tests/regression/tools/notification/test_notification_kernel_buffer_usage b/tests/regression/tools/notification/test_notification_kernel_buffer_usage index 76e69a77e..5a87583dc 100755 --- a/tests/regression/tools/notification/test_notification_kernel_buffer_usage +++ b/tests/regression/tools/notification/test_notification_kernel_buffer_usage @@ -7,13 +7,16 @@ CURDIR=$(dirname "$0")/ TESTDIR=$CURDIR/../../../ -TEST_TMPDIR=$(mktemp --tmpdir -d tmp.test_notif_kernel_buffer_usage_dir.XXXXXX) +TEST_TMPDIR=$(mktemp -d -t tmp.test_notif_kernel_buffer_usage_dir.XXXXXX) + +# Set TMPDIR for further call to mktemp +export TMPDIR="$TEST_TMPDIR" #This is needed since the testpoint create a pipe with the consumerd type suffixed TESTPOINT_BASE_PATH=$(readlink -f "$TEST_TMPDIR/lttng.t_p_n") -TESTPOINT_PIPE_PATH=$(mktemp -u --tmpdir="$TEST_TMPDIR" "lttng.t_p_n.XXXXXX") +TESTPOINT_PIPE_PATH=$(mktemp -u -t "lttng.t_p_n.XXXXXX") TESTPOINT=$(readlink -f "${CURDIR}/.libs/libpause_consumer.so") -TESTAPP_STATE_PATH=$(mktemp -u --tmpdir="$TEST_TMPDIR" "application_state.XXXXXXXXXX") +TESTAPP_STATE_PATH=$(mktemp -u -t "application_state.XXXXXXXXXX") SESSION_NAME="my_session" @@ -33,7 +36,7 @@ function test_buffer_usage_notification local page_size local consumerd_pipe=() - trace_path=$(mktemp -d --tmpdir="$TEST_TMPDIR" "tmp.${FUNCNAME[0]}_trace_path.XXXXXXX") + trace_path=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXXX") page_size=$(getconf PAGE_SIZE) create_lttng_session_notap $SESSION_NAME "$trace_path" diff --git a/tests/regression/tools/notification/test_notification_kernel_capture b/tests/regression/tools/notification/test_notification_kernel_capture index 88f123d3d..88a3691eb 100755 --- a/tests/regression/tools/notification/test_notification_kernel_capture +++ b/tests/regression/tools/notification/test_notification_kernel_capture @@ -8,7 +8,7 @@ CURDIR=$(dirname "$0")/ TESTDIR=$CURDIR/../../../ TESTAPP_PATH="$TESTDIR/utils/testapp" -TESTAPP_STATE_PATH=$(mktemp --tmpdir -u "tmp.test_notif_kernel_capture_application_state.XXXXXXXXXX") +TESTAPP_STATE_PATH=$(mktemp -u -t "tmp.test_notif_kernel_capture_application_state.XXXXXXXXXX") NUM_TESTS=104 diff --git a/tests/regression/tools/notification/test_notification_kernel_error b/tests/regression/tools/notification/test_notification_kernel_error index 80fe6e5b5..891146747 100755 --- a/tests/regression/tools/notification/test_notification_kernel_error +++ b/tests/regression/tools/notification/test_notification_kernel_error @@ -8,7 +8,7 @@ CURDIR=$(dirname "$0")/ TESTDIR=$CURDIR/../../../ TESTAPP_PATH="$TESTDIR/utils/testapp" -TESTAPP_STATE_PATH=$(mktemp --tmpdir -u "tmp.test_notif_kernel_error_application_state.XXXXXXXXXX") +TESTAPP_STATE_PATH=$(mktemp -u -t "tmp.test_notif_kernel_error_application_state.XXXXXXXXXX") NUM_TESTS=44 diff --git a/tests/regression/tools/notification/test_notification_kernel_instrumentation b/tests/regression/tools/notification/test_notification_kernel_instrumentation index 90545a541..b8f0c7eb8 100755 --- a/tests/regression/tools/notification/test_notification_kernel_instrumentation +++ b/tests/regression/tools/notification/test_notification_kernel_instrumentation @@ -7,7 +7,7 @@ CURDIR=$(dirname "$0")/ TESTDIR=$CURDIR/../../../ -TESTAPP_STATE_PATH=$(mktemp --tmpdir -u "tmp.test_notif_kernel_instrumentation_application_state.XXXXXXXXXX") +TESTAPP_STATE_PATH=$(mktemp -u -t "tmp.test_notif_kernel_instrumentation_application_state.XXXXXXXXXX") NUM_TESTS=13 diff --git a/tests/regression/tools/notification/test_notification_kernel_syscall b/tests/regression/tools/notification/test_notification_kernel_syscall index d273cb55d..ba12716fd 100755 --- a/tests/regression/tools/notification/test_notification_kernel_syscall +++ b/tests/regression/tools/notification/test_notification_kernel_syscall @@ -7,7 +7,7 @@ CURDIR=$(dirname "$0")/ TESTDIR=$CURDIR/../../../ -TESTAPP_STATE_PATH=$(mktemp --tmpdir -u "tmp.test_notif_kernel_syscall_application_state.XXXXXX") +TESTAPP_STATE_PATH=$(mktemp -u -t "tmp.test_notif_kernel_syscall_application_state.XXXXXX") NUM_TESTS=25 diff --git a/tests/regression/tools/notification/test_notification_kernel_userspace_probe b/tests/regression/tools/notification/test_notification_kernel_userspace_probe index 8ef8d708d..065e66add 100755 --- a/tests/regression/tools/notification/test_notification_kernel_userspace_probe +++ b/tests/regression/tools/notification/test_notification_kernel_userspace_probe @@ -7,7 +7,7 @@ CURDIR=$(dirname "$0")/ TESTDIR=$CURDIR/../../../ -TESTAPP_STATE_PATH=$(mktemp --tmpdir -u "tmp.test_notif_kernel_uprobe_application_state.XXXXXXXXXX") +TESTAPP_STATE_PATH=$(mktemp -u -t "tmp.test_notif_kernel_uprobe_application_state.XXXXXXXXXX") NUM_TESTS=13 diff --git a/tests/regression/tools/notification/test_notification_multi_app b/tests/regression/tools/notification/test_notification_multi_app index d8b639225..85d863804 100755 --- a/tests/regression/tools/notification/test_notification_multi_app +++ b/tests/regression/tools/notification/test_notification_multi_app @@ -14,7 +14,7 @@ TESTPOINT=$(readlink -f ${CURDIR}/.libs/libpause_consumer.so) TESTAPP_PATH="$TESTDIR/utils/testapp" TESTAPP_NAME="gen-ust-events" TESTAPP_BIN="$TESTAPP_PATH/$TESTAPP_NAME/$TESTAPP_NAME" -TESTAPP_STATE_FILE="$(mktemp --tmpdir -u tmp.test_notification_multi_app_state_file.XXXXXX)" +TESTAPP_STATE_FILE="$(mktemp -u -t tmp.test_notification_multi_app_state_file.XXXXXX)" NR_ITER=1000 NR_USEC_WAIT=5 @@ -35,7 +35,7 @@ source $TESTDIR/utils/utils.sh source $CURDIR/util_event_generator.sh consumerd_pipe=() -file_sync_after_first_event=$(mktemp --tmpdir -u tmp.test_notification_multi_app_sync_after_first.XXXXXX) +file_sync_after_first_event=$(mktemp -u -t tmp.test_notification_multi_app_sync_after_first.XXXXXX) # MUST set TESTDIR before calling those functions plan_tests $NUM_TESTS @@ -135,10 +135,10 @@ function test_multi_app () local app_pids=() local low_output_file_pattern="low_app_output_file_" local high_output_file_pattern="high_app_output_file_" - local output_dir=$(mktemp --tmpdir -d "tmp.test_${FUNCNAME[0]}_output_dir.XXXXXX") + local output_dir=$(mktemp -d -t "tmp.test_${FUNCNAME[0]}_output_dir.XXXXXX") local testpoint_base_path=$(readlink -f "$output_dir/lttng.t_p_n_multi_app") - local testpoint_pipe_path=$(mktemp --tmpdir="$output_dir" -u "lttng.t_p_n_multi_app.XXXXXX") + local testpoint_pipe_path=$(TMPDIR="$output_dir" mktemp -u -t "lttng.t_p_n_multi_app.XXXXXX") local nr_notification_expected=5 local nr_client_app=50 @@ -325,9 +325,9 @@ function test_on_register_evaluation () local app_pids=() local high_output_file_pattern="high_app_output_file_on_register_evaluation" - local output_dir=$(mktemp --tmpdir -d "tmp.test_${FUNCNAME[0]}_output_dir.XXXXXX") + local output_dir=$(mktemp -d -t "tmp.test_${FUNCNAME[0]}_output_dir.XXXXXX") local testpoint_base_path=$(readlink -f "$output_dir/lttng.t_p_n_register_evaluation") - local testpoint_pipe_path=$(mktemp --tmpdir="$output_dir" -u "lttng.t_p_n_register_evaluation.XXXXXX") + local testpoint_pipe_path=$(TMPDIR="$output_dir" mktemp -u -t "lttng.t_p_n_register_evaluation.XXXXXX") local domain_string="" local event_name="" @@ -430,7 +430,7 @@ fi for fct_test in ${TESTS[@]}; do - TRACE_PATH=$(mktemp --tmpdir -d tmp.test_notification_multi_app_trace_path.XXXXXX) + TRACE_PATH=$(mktemp -d -t tmp.test_notification_multi_app_trace_path.XXXXXX) ${fct_test} if [ $? -ne 0 ]; then diff --git a/tests/regression/tools/notification/test_notification_notifier_discarded_count b/tests/regression/tools/notification/test_notification_notifier_discarded_count index c9235393e..1eb960d02 100755 --- a/tests/regression/tools/notification/test_notification_notifier_discarded_count +++ b/tests/regression/tools/notification/test_notification_notifier_discarded_count @@ -7,14 +7,17 @@ CURDIR=$(dirname "$0")/ TESTDIR=$CURDIR/../../../ -TEST_TMPDIR=$(mktemp --tmpdir -d tmp.test_notifier_discarded_count.XXXXXX) +TEST_TMPDIR=$(mktemp -d -t tmp.test_notifier_discarded_count.XXXXXX) + +# Set TMPDIR for further call to mktemp +export TMPDIR="$TEST_TMPDIR" TESTAPP_PATH="$TESTDIR/utils/testapp" TESTAPP_NAME="gen-ust-events" TESTAPP_BIN="$TESTAPP_PATH/$TESTAPP_NAME/$TESTAPP_NAME" TESTPOINT_BASE_PATH=$(readlink -f "$TEST_TMPDIR/lttng.t_p_n") -TESTPOINT_PIPE_PATH=$(mktemp -u --tmpdir="$TEST_TMPDIR" "lttng.t_p_n.XXXXXX") +TESTPOINT_PIPE_PATH=$(mktemp -u -t "lttng.t_p_n.XXXXXX") TESTPOINT=$(readlink -f "${CURDIR}/.libs/libpause_sessiond.so") SH_TAP=1 @@ -37,7 +40,7 @@ plan_tests $NUM_TESTS function trigger_get_discarded_notif_number() { local trigger_name="$1" - local list_triggers_stdout=$(mktemp --tmpdir="$TEST_TMPDIR" "list_triggers_stdout.XXXXXX") + local list_triggers_stdout=$(mktemp -t "list_triggers_stdout.XXXXXX") "$FULL_LTTNG_BIN" list-triggers > "$list_triggers_stdout" @@ -60,7 +63,7 @@ function test_kernel_notifier_discarded_count { local sessiond_pipe=() local trigger_name="my_trigger" - local list_triggers_stdout=$(mktemp --tmpdir="$TEST_TMPDIR" "list_triggers_stdout.XXXXXX") + local list_triggers_stdout=$(mktemp -t "list_triggers_stdout.XXXXXX") # Used on sessiond launch. LTTNG_SESSIOND_ENV_VARS="LTTNG_TESTPOINT_ENABLE=1 \ @@ -244,7 +247,7 @@ function test_ust_notifier_discarded_count_multi_uid local sessiond_pipe=() local root_trigger_name="root_trigger" local user_trigger_name="user_trigger" - local list_triggers_stdout=$(mktemp --tmpdir="$TEST_TMPDIR" "list_triggers_stdout.XXXXXX") + local list_triggers_stdout=$(mktemp -t "list_triggers_stdout.XXXXXX") local NR_USEC_WAIT=0 local PIPE_SIZE local NR_ITER @@ -324,7 +327,7 @@ function test_ust_notifier_discarded_regardless_trigger_owner local sessiond_pipe=() local root_trigger_name="root_trigger" local user_trigger_name="user_trigger" - local list_triggers_stdout=$(mktemp --tmpdir="$TEST_TMPDIR" "list_triggers_stdout.XXXXXX") + local list_triggers_stdout=$(mktemp -t "list_triggers_stdout.XXXXXX") local NR_USEC_WAIT=0 local PIPE_SIZE local NR_ITER diff --git a/tests/regression/tools/notification/test_notification_ust_buffer_usage b/tests/regression/tools/notification/test_notification_ust_buffer_usage index 4a4c14f3a..836eceb2e 100755 --- a/tests/regression/tools/notification/test_notification_ust_buffer_usage +++ b/tests/regression/tools/notification/test_notification_ust_buffer_usage @@ -7,12 +7,15 @@ CURDIR=$(dirname "$0")/ TESTDIR=$CURDIR/../../../ -TEST_TMPDIR=$(mktemp --tmpdir -d tmp.test_notif_ust_buffer_usage_dir.XXXXXX) +TEST_TMPDIR=$(mktemp -d -t tmp.test_notif_ust_buffer_usage_dir.XXXXXX) + +# Set TMPDIR for further call to mktemp +export TMPDIR="$TEST_TMPDIR" set -x #This is needed since the testpoint create a pipe with the consumerd type suffixed TESTPOINT_BASE_PATH=$(readlink -f "$TEST_TMPDIR/lttng.t_p_n") -TESTPOINT_PIPE_PATH=$(mktemp -u --tmpdir="$TEST_TMPDIR" "lttng.t_p_n.XXXXXX") +TESTPOINT_PIPE_PATH=$(mktemp -u -t "lttng.t_p_n.XXXXXX") TESTPOINT=$(readlink -f "${CURDIR}/.libs/libpause_consumer.so") TESTAPP_PATH="$TESTDIR/utils/testapp" @@ -20,12 +23,12 @@ TESTAPP_PATH="$TESTDIR/utils/testapp" GEN_UST_EVENTS_TESTAPP_NAME="gen-ust-events" GEN_UST_EVENTS_TESTAPP_BIN="$TESTAPP_PATH/$GEN_UST_EVENTS_TESTAPP_NAME/$GEN_UST_EVENTS_TESTAPP_NAME" -TESTAPP_STATE_PATH=$(mktemp -u --tmpdir="$TEST_TMPDIR" "application_state.XXXXXXXXXX") +TESTAPP_STATE_PATH=$(mktemp -u -t "application_state.XXXXXXXXXX") SESSION_NAME="my_session" CHANNEL_NAME="my_channel" -TRACE_PATH=$(mktemp -d --tmpdir="$TEST_TMPDIR" "trace_path.XXXXXX") +TRACE_PATH=$(mktemp -d -t "trace_path.XXXXXX") PAGE_SIZE=$(getconf PAGE_SIZE) set +x diff --git a/tests/regression/tools/notification/test_notification_ust_capture b/tests/regression/tools/notification/test_notification_ust_capture index 3546d32ec..f16dbb647 100755 --- a/tests/regression/tools/notification/test_notification_ust_capture +++ b/tests/regression/tools/notification/test_notification_ust_capture @@ -12,7 +12,7 @@ TESTAPP_PATH="$TESTDIR/utils/testapp" GEN_UST_EVENTS_TESTAPP_NAME="gen-ust-events" GEN_UST_EVENTS_TESTAPP_BIN="$TESTAPP_PATH/$GEN_UST_EVENTS_TESTAPP_NAME/$GEN_UST_EVENTS_TESTAPP_NAME" -TESTAPP_STATE_PATH=$(mktemp --tmpdir -u "tmp.test_notif_ust_capture_application_state.XXXXXX") +TESTAPP_STATE_PATH=$(mktemp -u -t "tmp.test_notif_ust_capture_application_state.XXXXXX") # shellcheck source=../../../utils/utils.sh source "$TESTDIR/utils/utils.sh" diff --git a/tests/regression/tools/notification/test_notification_ust_error b/tests/regression/tools/notification/test_notification_ust_error index dead31059..e3b5e9859 100755 --- a/tests/regression/tools/notification/test_notification_ust_error +++ b/tests/regression/tools/notification/test_notification_ust_error @@ -13,7 +13,7 @@ TESTAPP_PATH="$TESTDIR/utils/testapp" GEN_UST_EVENTS_TESTAPP_NAME="gen-ust-events" GEN_UST_EVENTS_TESTAPP_BIN="$TESTAPP_PATH/$GEN_UST_EVENTS_TESTAPP_NAME/$GEN_UST_EVENTS_TESTAPP_NAME" -TESTAPP_STATE_PATH=$(mktemp --tmpdir -u "tmp.test_notif_ust_error_application_state.XXXXXX") +TESTAPP_STATE_PATH=$(mktemp -u -t "tmp.test_notif_ust_error_application_state.XXXXXX") # shellcheck source=../../../utils/utils.sh source "$TESTDIR/utils/utils.sh" diff --git a/tests/regression/tools/notification/test_notification_ust_event_rule_condition_exclusion b/tests/regression/tools/notification/test_notification_ust_event_rule_condition_exclusion index c15ecff08..b8dbcc859 100755 --- a/tests/regression/tools/notification/test_notification_ust_event_rule_condition_exclusion +++ b/tests/regression/tools/notification/test_notification_ust_event_rule_condition_exclusion @@ -12,7 +12,7 @@ TESTAPP_PATH="$TESTDIR/utils/testapp" GEN_UST_NEVENTS_TESTAPP_NAME="gen-ust-nevents" GEN_UST_NEVENTS_TESTAPP_BIN="$TESTAPP_PATH/$GEN_UST_NEVENTS_TESTAPP_NAME/$GEN_UST_NEVENTS_TESTAPP_NAME" -TESTAPP_STATE_PATH=$(mktemp --tmpdir -u "tmp.test_notif_event_rule_exclusion_ust_application_state.XXXXXX") +TESTAPP_STATE_PATH=$(mktemp -u -t "tmp.test_notif_event_rule_exclusion_ust_application_state.XXXXXX") # shellcheck source=../../../utils/utils.sh source "$TESTDIR/utils/utils.sh" diff --git a/tests/regression/tools/notification/test_rotation b/tests/regression/tools/notification/test_rotation index 90f788786..5d6db8f55 100755 --- a/tests/regression/tools/notification/test_rotation +++ b/tests/regression/tools/notification/test_rotation @@ -12,13 +12,13 @@ TESTAPP_NAME="gen-ust-events" TESTAPP_BIN="$TESTAPP_PATH/$TESTAPP_NAME/$TESTAPP_NAME" SESSION_NAME="my_session" -SESSION_OUTPUT_PATH=$(mktemp --tmpdir -d tmp.test_notif_rotation_trace_path.XXXXXX) +SESSION_OUTPUT_PATH=$(mktemp -d -t tmp.test_notif_rotation_trace_path.XXXXXX) EVENT_NAME="tp:tptest" PAGE_SIZE=$(getconf PAGE_SIZE) SUBBUF_SIZE=$(expr $PAGE_SIZE \* 8) -FILE_SYNC_AFTER_FIRST_EVENT=$(mktemp --tmpdir -u tmp.test_rotation_sync_after_first.XXXXXX) +FILE_SYNC_AFTER_FIRST_EVENT=$(mktemp -u -t tmp.test_rotation_sync_after_first.XXXXXX) NR_ITER=-1 NR_USEC_WAIT=5 diff --git a/tests/regression/tools/regen-metadata/test_kernel b/tests/regression/tools/regen-metadata/test_kernel index 49eea32a7..7c4191a47 100755 --- a/tests/regression/tools/regen-metadata/test_kernel +++ b/tests/regression/tools/regen-metadata/test_kernel @@ -11,7 +11,7 @@ TESTDIR=$CURDIR/../../.. EVENT_NAME="lttng_test_filter_event" SESSION_NAME="" -TRACE_PATH=$(mktemp --tmpdir -d tmp.test_regen_metadata_kernel_trace_path.XXXXXX) +TRACE_PATH=$(mktemp -d -t tmp.test_regen_metadata_kernel_trace_path.XXXXXX) NUM_TESTS=32 diff --git a/tests/regression/tools/regen-metadata/test_ust b/tests/regression/tools/regen-metadata/test_ust index 224a37995..a48221323 100755 --- a/tests/regression/tools/regen-metadata/test_ust +++ b/tests/regression/tools/regen-metadata/test_ust @@ -16,7 +16,7 @@ TESTAPP_BIN="$TESTAPP_PATH/$TESTAPP_NAME/$TESTAPP_NAME" SESSION_NAME="stream" EVENT_NAME="tp:tptest" -TRACE_PATH=$(mktemp --tmpdir -d tmp.test_regen_metadata_ust_trace_path.XXXXXX) +TRACE_PATH=$(mktemp -d -t tmp.test_regen_metadata_ust_trace_path.XXXXXX) NUM_TESTS=47 @@ -39,8 +39,8 @@ function enable_channel_per_pid() function test_ust_streaming () { - 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") + local file_sync_after_first=$(mktemp -u -t "tmp.${FUNCNAME[0]}_sync_after_first.XXXXXX") + local file_sync_before_last=$(mktemp -u -t "tmp.${FUNCNAME[0]}_sync_before_last.XXXXXX") local metadata_path diag "Test UST streaming with metadata regeneration" @@ -83,8 +83,8 @@ function test_ust_streaming () function test_ust_local () { - 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") + local file_sync_after_first=$(mktemp -u -t "tmp.${FUNCNAME[0]}_sync_after_first.XXXXXX") + local file_sync_before_last=$(mktemp -u -t "tmp.${FUNCNAME[0]}_sync_before_last.XXXXXX") local metadata_path diag "Test UST local with metadata regeneration" @@ -127,8 +127,8 @@ function test_ust_local () function test_ust_pid () { - 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") + local file_sync_after_first=$(mktemp -u -t "tmp.${FUNCNAME[0]}_sync_after_first.XXXXXX") + local file_sync_before_last=$(mktemp -u -t "tmp.${FUNCNAME[0]}_sync_before_last.XXXXXX") diag "Test UST per-pid with metadata regeneration (expect failure)" create_lttng_session_ok $SESSION_NAME $TRACE_PATH @@ -161,8 +161,8 @@ function test_ust_pid () function test_ust_live () { - 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") + local file_sync_after_first=$(mktemp -u -t "tmp.${FUNCNAME[0]}_sync_after_first.XXXXXX") + local file_sync_before_last=$(mktemp -u -t "tmp.${FUNCNAME[0]}_sync_before_last.XXXXXX") diag "Test UST live with metadata regeneration (expect failure)" create_lttng_session_uri $SESSION_NAME net://localhost --live diff --git a/tests/regression/tools/regen-statedump/test_kernel b/tests/regression/tools/regen-statedump/test_kernel index 8a261355d..cb0c0ad5e 100755 --- a/tests/regression/tools/regen-statedump/test_kernel +++ b/tests/regression/tools/regen-statedump/test_kernel @@ -12,7 +12,7 @@ EVENT_NAME="lttng_test_filter_event" SESSION_NAME="" EVENT_NAME="lttng_statedump_start,lttng_statedump_end" -TRACE_PATH=$(mktemp --tmpdir -d tmp.test_regenerate_statedump_kernel_trace_path.XXXXXX) +TRACE_PATH=$(mktemp -d -t tmp.test_regenerate_statedump_kernel_trace_path.XXXXXX) NUM_TESTS=11 diff --git a/tests/regression/tools/regen-statedump/test_ust b/tests/regression/tools/regen-statedump/test_ust index 29e1d1b9d..1a872c995 100755 --- a/tests/regression/tools/regen-statedump/test_ust +++ b/tests/regression/tools/regen-statedump/test_ust @@ -16,7 +16,7 @@ TESTAPP_BIN="$TESTAPP_PATH/$TESTAPP_NAME/$TESTAPP_NAME" SESSION_NAME="stream" EVENT_NAME="lttng_ust_statedump:start,lttng_ust_statedump:end" -TRACE_PATH=$(mktemp --tmpdir -d tmp.test_regenerate_statedump_ust_trace_path.XXXXXX) +TRACE_PATH=$(mktemp -d -t tmp.test_regenerate_statedump_ust_trace_path.XXXXXX) NUM_TESTS=11 @@ -28,8 +28,8 @@ fi function test_ust_local () { - local file_sync_after_first=$(mktemp --tmpdir -u tmp.test_${FUNCNAME[0]}_sync_after_first.XXXXXX) - local file_sync_before_last=$(mktemp --tmpdir -u tmp.test_${FUNCNAME[0]}_sync_before_last.XXXXXX) + local file_sync_after_first=$(mktemp -u -t tmp.test_${FUNCNAME[0]}_sync_after_first.XXXXXX) + local file_sync_before_last=$(mktemp -u -t tmp.test_${FUNCNAME[0]}_sync_before_last.XXXXXX) diag "Test UST local with statedump regeneration" create_lttng_session_ok $SESSION_NAME $TRACE_PATH diff --git a/tests/regression/tools/relayd-grouping/test_ust b/tests/regression/tools/relayd-grouping/test_ust index 592dbd90d..09929e25d 100755 --- a/tests/regression/tools/relayd-grouping/test_ust +++ b/tests/regression/tools/relayd-grouping/test_ust @@ -34,7 +34,7 @@ function get_auto_session_name () local lttng_bin=$LTTNG_BIN LTTNG_BIN="${lttng_bin} --mi xml" - OUTPUT_DEST=$(mktemp --tmpdir "tmp.${FUNCNAME[0]}_output.XXXXXX") + OUTPUT_DEST=$(mktemp -t "tmp.${FUNCNAME[0]}_output.XXXXXX") list_lttng_ok $MI_VALIDATE "$OUTPUT_DEST" @@ -457,8 +457,8 @@ function test_ust_pid_streaming_snapshot () local file_sync_after_first local file_sync_before_last - file_sync_after_first=$(mktemp --tmpdir -u "tmp.${FUNCNAME[0]}_sync_after_first.XXXXXX") - file_sync_before_last=$(mktemp --tmpdir -u "tmp.${FUNCNAME[0]}_sync_before_last.XXXXXX") + file_sync_after_first=$(mktemp -u -t "tmp.${FUNCNAME[0]}_sync_after_first.XXXXXX") + file_sync_before_last=$(mktemp -u -t "tmp.${FUNCNAME[0]}_sync_before_last.XXXXXX") if [ -z "$session_name" ]; then is_automatic_session=true @@ -672,7 +672,7 @@ for fct_test in "${tests[@]}"; do for grouping in "${grouping_types[@]}"; do - TRACE_PATH=$(mktemp --tmpdir -d tmp.test_relayd_grouping_ust_trace_path.XXXXXX) + TRACE_PATH=$(mktemp -d -t tmp.test_relayd_grouping_ust_trace_path.XXXXXX) # Set the relayd in --group-output-by-session mode start_lttng_relayd "-o $TRACE_PATH $grouping" start_lttng_sessiond diff --git a/tests/regression/tools/rotation/test_kernel b/tests/regression/tools/rotation/test_kernel index 760930e95..817019036 100755 --- a/tests/regression/tools/rotation/test_kernel +++ b/tests/regression/tools/rotation/test_kernel @@ -10,7 +10,7 @@ CURDIR=$(dirname $0)/ TESTDIR=$CURDIR/../../.. EVENT_NAME="lttng_test_filter_event" -TRACE_PATH=$(mktemp --tmpdir -d -t tmp.rotation_kernel_tracing.XXXXXX) +TRACE_PATH=$(mktemp -d -t tmp.rotation_kernel_tracing.XXXXXX) NUM_TESTS=66 diff --git a/tests/regression/tools/rotation/test_save_load_mi b/tests/regression/tools/rotation/test_save_load_mi index 6a1f42101..94c98c988 100755 --- a/tests/regression/tools/rotation/test_save_load_mi +++ b/tests/regression/tools/rotation/test_save_load_mi @@ -28,9 +28,9 @@ XPATH_LIST_ROTATE_SIZE="$XPATH_SESSION/lttng:rotation_schedules/lttng:size_thres function test_save_load_mi () { - 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") + local tmp_xml_output=$(mktemp -u -t "tmp.${FUNCNAME[0]}_xml_output.XXXXXX") + local tmp_save_output=$(mktemp -d -t "tmp.${FUNCNAME[0]}_save_output.XXXXXX") + local trace_path=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") diag "Test save/load/list/MI with rotation" create_lttng_session_ok $SESSION_NAME $trace_path diff --git a/tests/regression/tools/rotation/test_schedule_api b/tests/regression/tools/rotation/test_schedule_api index 8b4f42d19..e2be8c1b8 100755 --- a/tests/regression/tools/rotation/test_schedule_api +++ b/tests/regression/tools/rotation/test_schedule_api @@ -10,7 +10,7 @@ CURDIR=$(dirname $0)/ TESTDIR=$CURDIR/../../.. SESSION_NAME="my_session" -TRACE_PATH=$(mktemp --tmpdir -d -t tmp.rotation_schedule_api.XXXXXX) +TRACE_PATH=$(mktemp -d -t tmp.rotation_schedule_api.XXXXXX) source $TESTDIR/utils/utils.sh diff --git a/tests/regression/tools/rotation/test_ust b/tests/regression/tools/rotation/test_ust index 043b123bf..cbeb47d8a 100755 --- a/tests/regression/tools/rotation/test_ust +++ b/tests/regression/tools/rotation/test_ust @@ -15,7 +15,7 @@ TESTAPP_BIN="$TESTAPP_PATH/$TESTAPP_NAME/$TESTAPP_NAME" SESSION_NAME="stream" EVENT_NAME="tp:tptest" -TRACE_PATH=$(mktemp --tmpdir -d -t tmp.test_ust_rotation_trace_path.XXXXXX) +TRACE_PATH=$(mktemp -d -t tmp.test_ust_rotation_trace_path.XXXXXX) NUM_TESTS=152 diff --git a/tests/regression/tools/rotation/test_ust_kernel b/tests/regression/tools/rotation/test_ust_kernel index 4f8294ef0..2f19e807a 100755 --- a/tests/regression/tools/rotation/test_ust_kernel +++ b/tests/regression/tools/rotation/test_ust_kernel @@ -16,7 +16,7 @@ SESSION_NAME="stream" UST_EVENT_NAME="tp:tptest" KERNEL_EVENT_NAME="lttng_test_filter_event" -TRACE_PATH=$(mktemp --tmpdir -d -t tmp.rotation_ust_kernel_tracing.XXXXXX) +TRACE_PATH=$(mktemp -d -t tmp.rotation_ust_kernel_tracing.XXXXXX) NUM_TESTS=64 diff --git a/tests/regression/tools/save-load/test_autoload b/tests/regression/tools/save-load/test_autoload index ddf54db59..df3fbf153 100755 --- a/tests/regression/tools/save-load/test_autoload +++ b/tests/regression/tools/save-load/test_autoload @@ -62,8 +62,8 @@ TESTS=( for fct_test in ${TESTS[@]}; do - export LTTNG_HOME=$(mktemp --tmpdir -d tmp.test_lttng_home_dir.XXXXXX) - export LTTNG_DIR=$(mktemp --tmpdir -d tmp.test_lttng_dir.XXXXXX) + export LTTNG_HOME=$(mktemp -d -t tmp.test_lttng_home_dir.XXXXXX) + export LTTNG_DIR=$(mktemp -d -t tmp.test_lttng_dir.XXXXXX) ${fct_test} rm -rf $LTTNG_DIR diff --git a/tests/regression/tools/save-load/test_load b/tests/regression/tools/save-load/test_load index cbdf96f6e..f149acd08 100755 --- a/tests/regression/tools/save-load/test_load +++ b/tests/regression/tools/save-load/test_load @@ -58,7 +58,7 @@ function test_complex_load() disable_ust_lttng_channel $sess chan3 # Confirm that an event stored as disabled is restored in its disabled state - local mi_output_file=$(mktemp --tmpdir "tmp.${FUNCNAME[0]}_output_file.XXXXXX") + local mi_output_file=$(mktemp -t "tmp.${FUNCNAME[0]}_output_file.XXXXXX") if [ $? -ne 0 ]; then break; fi @@ -127,7 +127,7 @@ function test_trackers() lttng_load_ok "-i $CURDIR/$SESSION_NAME-trackers.lttng" diag "Test pid tracker" - local mi_output_file=$(mktemp --tmpdir "tmp.${FUNCNAME[0]}_output_file.XXXXXX") + local mi_output_file=$(mktemp -t "tmp.${FUNCNAME[0]}_output_file.XXXXXX") if [ $? -ne 0 ]; then break; fi @@ -176,7 +176,7 @@ function test_override_url_normal() start_lttng_relayd "-C tcp://127.0.0.1:8172 -D tcp://127.0.0.1:9817" - local mi_output_file=$(mktemp --tmpdir "tmp.${FUNCNAME[0]}_output_file.XXXXXX") + local mi_output_file=$(mktemp -t "tmp.${FUNCNAME[0]}_output_file.XXXXXX") if [ $? -ne 0 ]; then break; fi @@ -226,7 +226,7 @@ function test_override_url_snapshot() start_lttng_relayd "-C tcp://127.0.0.1:8172 -D tcp://127.0.0.1:9817" - local mi_output_file=$(mktemp --tmpdir "tmp.${FUNCNAME[0]}_output_file.XXXXXX") + local mi_output_file=$(mktemp -t "tmp.${FUNCNAME[0]}_output_file.XXXXXX") if [ $? -ne 0 ]; then break; fi @@ -280,7 +280,7 @@ function test_override_url_live() start_lttng_relayd "-C tcp://127.0.0.1:8172 -D tcp://127.0.0.1:9817" - local mi_output_file=$(mktemp --tmpdir "tmp.${FUNCNAME[0]}_output_file.XXXXXX") + local mi_output_file=$(mktemp -t "tmp.${FUNCNAME[0]}_output_file.XXXXXX") if [ $? -ne 0 ]; then break; fi @@ -316,7 +316,7 @@ function test_override_session_name() local override_name="PinkyAndTheBrain" local output_path="/tmp/lttng/load-42-1" - local mi_output_file=$(mktemp --tmpdir "tmp.${FUNCNAME[0]}_output_file.XXXXXX") + local mi_output_file=$(mktemp -t "tmp.${FUNCNAME[0]}_output_file.XXXXXX") if [ $? -ne 0 ]; then break; fi @@ -362,7 +362,7 @@ TESTS=( for fct_test in ${TESTS[@]}; do - TRACE_PATH=$(mktemp --tmpdir -d tmp.test_load_trace_path.XXXXXX) + TRACE_PATH=$(mktemp -d -t tmp.test_load_trace_path.XXXXXX) ${fct_test} if [ $? -ne 0 ]; then diff --git a/tests/regression/tools/save-load/test_save b/tests/regression/tools/save-load/test_save index 73527ec7b..47b792dc9 100755 --- a/tests/regression/tools/save-load/test_save +++ b/tests/regression/tools/save-load/test_save @@ -134,7 +134,7 @@ TESTS=( for fct_test in ${TESTS[@]}; do - TRACE_PATH=$(mktemp --tmpdir -d tmp.test_save_trace_path.XXXXXX) + TRACE_PATH=$(mktemp -d -t tmp.test_save_trace_path.XXXXXX) ${fct_test} if [ $? -ne 0 ]; then diff --git a/tests/regression/tools/snapshots/test_kernel b/tests/regression/tools/snapshots/test_kernel index f1015ee25..e22a78a24 100755 --- a/tests/regression/tools/snapshots/test_kernel +++ b/tests/regression/tools/snapshots/test_kernel @@ -12,7 +12,7 @@ EVENT_NAME="sched_switch" SESSION_NAME="" CHANNEL_NAME="snapchan" -TRACE_PATH=$(mktemp --tmpdir -d tmp.test_snapshots_kernel_trace_path.XXXXXX) +TRACE_PATH=$(mktemp -d -t tmp.test_snapshots_kernel_trace_path.XXXXXX) NUM_TESTS=2061 diff --git a/tests/regression/tools/snapshots/test_kernel_streaming b/tests/regression/tools/snapshots/test_kernel_streaming index 0c92dc710..2abd838e7 100755 --- a/tests/regression/tools/snapshots/test_kernel_streaming +++ b/tests/regression/tools/snapshots/test_kernel_streaming @@ -12,7 +12,7 @@ EVENT_NAME="sched_switch" SESSION_NAME="" CHANNEL_NAME="chan1" -TRACE_PATH=$(mktemp --tmpdir -d tmp.test_snapshots_kernel_streaming_trace_path.XXXXXX) +TRACE_PATH=$(mktemp -d -t tmp.test_snapshots_kernel_streaming_trace_path.XXXXXX) NUM_TESTS=66 diff --git a/tests/regression/tools/snapshots/test_ust_streaming b/tests/regression/tools/snapshots/test_ust_streaming index 24e52c416..3104afb3b 100755 --- a/tests/regression/tools/snapshots/test_ust_streaming +++ b/tests/regression/tools/snapshots/test_ust_streaming @@ -19,7 +19,7 @@ NR_ITER=-1 NR_USEC_WAIT=100 APPS_PID= -TRACE_PATH=$(mktemp --tmpdir -d tmp.test_snapshots_ust_streaming_trace_path.XXXXXX) +TRACE_PATH=$(mktemp -d -t tmp.test_snapshots_ust_streaming_trace_path.XXXXXX) NUM_TESTS=85 @@ -47,7 +47,7 @@ function snapshot_add_output () # Start trace application and return once one event has been hit. function start_test_app() { - local tmp_file=$(mktemp --tmpdir -u tmp.test_${FUNCNAME[0]}_tmp_file.XXXXXX) + local tmp_file=$(mktemp -u -t tmp.test_${FUNCNAME[0]}_tmp_file.XXXXXX) # Start application with a temporary file. $TESTAPP_BIN -i $NR_ITER -w $NR_USEC_WAIT --sync-after-first-event $tmp_file & diff --git a/tests/regression/tools/snapshots/ust_test b/tests/regression/tools/snapshots/ust_test index e2e84b5c3..0224e7830 100755 --- a/tests/regression/tools/snapshots/ust_test +++ b/tests/regression/tools/snapshots/ust_test @@ -18,7 +18,7 @@ APPS_PID= NUM_TESTS=105 -TRACE_PATH=$(mktemp --tmpdir -d tmp.test_snapshots_ust_trace_path.XXXXXX) +TRACE_PATH=$(mktemp -d -t tmp.test_snapshots_ust_trace_path.XXXXXX) source $TESTDIR/utils/utils.sh @@ -36,7 +36,7 @@ NUM_TESTS=$(($NUM_TESTS + ($NR_SNAPSHOT * 3))) function start_test_app() { - local tmp_file=$(mktemp --tmpdir -u "tmp.${FUNCNAME[0]}_tmp_file.XXXXXX") + local tmp_file=$(mktemp -u -t "tmp.${FUNCNAME[0]}_tmp_file.XXXXXX") # Start application with a temporary file. $TESTAPP_BIN -i $NR_ITER -w $NR_USEC_WAIT --sync-after-first-event $tmp_file & diff --git a/tests/regression/tools/streaming/test_high_throughput_limits b/tests/regression/tools/streaming/test_high_throughput_limits index cd97dc776..359cc101a 100755 --- a/tests/regression/tools/streaming/test_high_throughput_limits +++ b/tests/regression/tools/streaming/test_high_throughput_limits @@ -20,7 +20,7 @@ SESSIOND_CTRL_PORT=5342 SESSIOND_DATA_PORT=5343 DEFAULT_IF="lo" -TRACE_PATH=$(mktemp --tmpdir -d tmp.test_streaming_high_throughput_limits_trace_path.XXXXXX) +TRACE_PATH=$(mktemp -d -t tmp.test_streaming_high_throughput_limits_trace_path.XXXXXX) NUM_TESTS=104 @@ -126,8 +126,8 @@ function test_high_throughput function validate_event_count { - TEMP_FILE=$(mktemp --tmpdir tmp.streaming_high_throughput_limit_file1.XXXXXX) - TEMP_FILE_2=$(mktemp --tmpdir tmp.streaming_high_throughput_limit_file2.XXXXXX) + TEMP_FILE=$(mktemp -t tmp.streaming_high_throughput_limit_file1.XXXXXX) + TEMP_FILE_2=$(mktemp -t tmp.streaming_high_throughput_limit_file2.XXXXXX) traced=$("$BABELTRACE_BIN" $TRACE_PATH 2>/dev/null | wc -l) "$BABELTRACE_BIN" $TRACE_PATH >/dev/null 2>$TEMP_FILE_2 diff --git a/tests/regression/tools/streaming/test_kernel b/tests/regression/tools/streaming/test_kernel index 33334229f..aef1e11bc 100755 --- a/tests/regression/tools/streaming/test_kernel +++ b/tests/regression/tools/streaming/test_kernel @@ -11,7 +11,7 @@ TESTDIR=$CURDIR/../../.. EVENT_NAME="sched_switch" SESSION_NAME="" -TRACE_PATH=$(mktemp --tmpdir -d tmp.test_streaming_kernel_trace_path.XXXXXX) +TRACE_PATH=$(mktemp -d -t tmp.test_streaming_kernel_trace_path.XXXXXX) NUM_TESTS=11 diff --git a/tests/regression/tools/streaming/test_ust b/tests/regression/tools/streaming/test_ust index b88e945f8..27f6b679b 100755 --- a/tests/regression/tools/streaming/test_ust +++ b/tests/regression/tools/streaming/test_ust @@ -16,7 +16,7 @@ TESTAPP_BIN="$TESTAPP_PATH/$TESTAPP_NAME/$TESTAPP_NAME" SESSION_NAME="stream" EVENT_NAME="tp:tptest" -TRACE_PATH=$(mktemp --tmpdir -d tmp.test_streaming_ust_trace_path.XXXXXX) +TRACE_PATH=$(mktemp -d -t tmp.test_streaming_ust_trace_path.XXXXXX) NUM_TESTS=18 @@ -30,7 +30,7 @@ fi function test_ust_before_start () { - local file_sync_before_last=$(mktemp --tmpdir -u "tmp.test_${FUNCNAME[0]}_sync_before_last.XXXXXX") + local file_sync_before_last=$(mktemp -u -t "tmp.test_${FUNCNAME[0]}_sync_before_last.XXXXXX") diag "Test UST streaming BEFORE tracing starts" create_lttng_session_uri $SESSION_NAME net://localhost @@ -53,7 +53,7 @@ function test_ust_before_start () function test_ust_after_start () { - local file_sync_after_first=$(mktemp --tmpdir -u "tmp.test_${FUNCNAME[0]}_sync_after_first.XXXXXX") + local file_sync_after_first=$(mktemp -u -t "tmp.test_${FUNCNAME[0]}_sync_after_first.XXXXXX") diag "Test UST streaming AFTER tracing starts" create_lttng_session_uri $SESSION_NAME net://localhost diff --git a/tests/regression/tools/tracefile-limits/test_tracefile_count b/tests/regression/tools/tracefile-limits/test_tracefile_count index 5f114af04..7f6032d71 100755 --- a/tests/regression/tools/tracefile-limits/test_tracefile_count +++ b/tests/regression/tools/tracefile-limits/test_tracefile_count @@ -111,7 +111,7 @@ function test_tracefile_count_limit () local session_name local stream_pattern=".*${channel_name}_${cpuno}_[0-9]*" local stream_size=0 - local trace_path=$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + local trace_path=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") session_name=$(randstring 16 0) diff --git a/tests/regression/tools/tracefile-limits/test_tracefile_size b/tests/regression/tools/tracefile-limits/test_tracefile_size index 5d9f21b60..489e68510 100755 --- a/tests/regression/tools/tracefile-limits/test_tracefile_size +++ b/tests/regression/tools/tracefile-limits/test_tracefile_size @@ -85,7 +85,7 @@ function check_file_size () function test_tracefile_size_limit () { local size_limit="$1" - local trace_path=$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + local trace_path=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") local session_name=$(randstring 16 0) local channel_name="channel" local event_name="tp:tptest" @@ -125,7 +125,7 @@ function test_tracefile_size_limit_pagesize () { # Set a size limit lower than the page_size local size_limit="$(($PAGE_SIZE-2))" - local trace_path=$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + local trace_path=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") local session_name=$(randstring 16 0) local channel_name="channel" local event_name="tp:tptest" diff --git a/tests/regression/tools/tracker/test_event_tracker b/tests/regression/tools/tracker/test_event_tracker index deecb8f80..98ca990fc 100755 --- a/tests/regression/tools/tracker/test_event_tracker +++ b/tests/regression/tools/tracker/test_event_tracker @@ -40,8 +40,8 @@ source $TESTDIR/utils/utils.sh # untracking on an active app. function prepare_ust_app { - TOUCH_BEFORE_LAST_PATH=$(mktemp --tmpdir -u tmp.${FUNCNAME[0]}_touch_before_last.XXXXXX) - SYNC_BEFORE_LAST_PATH=$(mktemp --tmpdir -u tmp.${FUNCNAME[0]}_sync_before_last.XXXXXX) + TOUCH_BEFORE_LAST_PATH=$(mktemp -u -t tmp.${FUNCNAME[0]}_touch_before_last.XXXXXX) + SYNC_BEFORE_LAST_PATH=$(mktemp -u -t tmp.${FUNCNAME[0]}_sync_before_last.XXXXXX) $TESTAPP_BIN -i $NR_ITER -w $NR_USEC_WAIT \ --sync-before-last-event-touch "$TOUCH_BEFORE_LAST_PATH" \ @@ -69,7 +69,7 @@ function trace_ust_app function prepare_kernel_app { - WAIT_PATH=$(mktemp --tmpdir -u "tmp.${FUNCNAME[0]}_wait_path.XXXXXX") + WAIT_PATH=$(mktemp -u -t "tmp.${FUNCNAME[0]}_wait_path.XXXXXX") "$TESTAPP_KERNEL_BIN" "$WAIT_PATH" $NR_ITER & CHILD_PID=$! @@ -94,7 +94,7 @@ function test_event_tracker() diag "${FUNCNAME[0]} $*" - trace_path=$(mktemp --tmpdir -d tmp.${FUNCNAME[0]}_trace_path.XXXXXX) + trace_path=$(mktemp -d -t tmp.${FUNCNAME[0]}_trace_path.XXXXXX) create_lttng_session_ok $SESSION_NAME "$trace_path" @@ -135,7 +135,7 @@ function test_event_vpid_tracker() diag "${FUNCNAME[0]} $*" - trace_path=$(mktemp --tmpdir -d tmp.${FUNCNAME[0]}_trace_path.XXXXXX) + trace_path=$(mktemp -d -t tmp.${FUNCNAME[0]}_trace_path.XXXXXX) create_lttng_session_ok $SESSION_NAME "$trace_path" @@ -180,7 +180,7 @@ function test_event_pid_tracker() diag "${FUNCNAME[0]} $*" - trace_path=$(mktemp --tmpdir -d tmp.${FUNCNAME[0]}_trace_path.XXXXXX) + trace_path=$(mktemp -d -t tmp.${FUNCNAME[0]}_trace_path.XXXXXX) create_lttng_session_ok $SESSION_NAME "$trace_path" @@ -225,7 +225,7 @@ function test_event_tracker_fail() diag "${FUNCNAME[0]} $*" - trace_path=$(mktemp --tmpdir -d tmp.${FUNCNAME[0]}_trace_path.XXXXXX) + trace_path=$(mktemp -d -t tmp.${FUNCNAME[0]}_trace_path.XXXXXX) create_lttng_session_ok $SESSION_NAME "$trace_path" enable_"$domain"_lttng_event_ok $SESSION_NAME "$wildcard" @@ -246,7 +246,7 @@ function test_event_track_untrack() diag "${FUNCNAME[0]} $*" - trace_path=$(mktemp --tmpdir -d tmp.${FUNCNAME[0]}_trace_path.XXXXXX) + trace_path=$(mktemp -d -t tmp.${FUNCNAME[0]}_trace_path.XXXXXX) create_lttng_session_ok $SESSION_NAME "$trace_path" @@ -288,7 +288,7 @@ function test_event_vpid_track_untrack() diag "${FUNCNAME[0]} $*" - trace_path=$(mktemp --tmpdir -d tmp.${FUNCNAME[0]}_trace_path.XXXXXX) + trace_path=$(mktemp -d -t tmp.${FUNCNAME[0]}_trace_path.XXXXXX) create_lttng_session_ok $SESSION_NAME "$trace_path" @@ -330,7 +330,7 @@ function test_event_pid_track_untrack() diag "${FUNCNAME[0]} $*" - trace_path=$(mktemp --tmpdir -d tmp.${FUNCNAME[0]}_trace_path.XXXXXX) + trace_path=$(mktemp -d -t tmp.${FUNCNAME[0]}_trace_path.XXXXXX) create_lttng_session_ok $SESSION_NAME "$trace_path" @@ -366,7 +366,7 @@ function test_event_ust_vpid_untrack_snapshot() { diag "${FUNCNAME[0]} $*" - local trace_path=$(mktemp --tmpdir -d tmp.${FUNCNAME[0]}_trace_path.XXXXXX) + local trace_path=$(mktemp -d -t tmp.${FUNCNAME[0]}_trace_path.XXXXXX) create_lttng_session_ok $SESSION_NAME "$trace_path" "--snapshot" diff --git a/tests/regression/tools/trigger/hidden/test_hidden_trigger b/tests/regression/tools/trigger/hidden/test_hidden_trigger index 0adce61eb..75387f3fc 100755 --- a/tests/regression/tools/trigger/hidden/test_hidden_trigger +++ b/tests/regression/tools/trigger/hidden/test_hidden_trigger @@ -8,7 +8,7 @@ TEST_DESC="Triggers - Hidden internal triggers" CURDIR=$(dirname "$0")/ TESTDIR=${CURDIR}/../../../.. -TRACE_PATH=$(mktemp --tmpdir -d -t tmp.test_trigger_hidden.XXXXXX) +TRACE_PATH=$(mktemp -d -t tmp.test_trigger_hidden.XXXXXX) # shellcheck source=../../../../utils/utils.sh source "$TESTDIR/utils/utils.sh" diff --git a/tests/regression/tools/trigger/rate-policy/test_ust_rate_policy b/tests/regression/tools/trigger/rate-policy/test_ust_rate_policy index ee5b590bd..cf68144f8 100755 --- a/tests/regression/tools/trigger/rate-policy/test_ust_rate_policy +++ b/tests/regression/tools/trigger/rate-policy/test_ust_rate_policy @@ -28,7 +28,7 @@ function test_rate_policy_every_n() local END_TRIGGER_NAME="end-trigger1" local SYNC_AFTER_NOTIF_REGISTER_PATH - SYNC_AFTER_NOTIF_REGISTER_PATH=$(mktemp --tmpdir -u test-notif-register.XXXXXX) + SYNC_AFTER_NOTIF_REGISTER_PATH=$(mktemp -u -t test-notif-register.XXXXXX) diag "Every N rate policy" @@ -114,7 +114,7 @@ function test_rate_policy_once_after_n() local END_TRIGGER_NAME="end-trigger1" local SYNC_AFTER_NOTIF_REGISTER_PATH - SYNC_AFTER_NOTIF_REGISTER_PATH=$(mktemp --tmpdir -u test-notif-register.XXXXXX) + SYNC_AFTER_NOTIF_REGISTER_PATH=$(mktemp -u -t test-notif-register.XXXXXX) diag "Once after N rate policy" diff --git a/tests/regression/tools/trigger/start-stop/test_start_stop b/tests/regression/tools/trigger/start-stop/test_start_stop index 823fb27a8..9a6d52b35 100755 --- a/tests/regression/tools/trigger/start-stop/test_start_stop +++ b/tests/regression/tools/trigger/start-stop/test_start_stop @@ -42,8 +42,8 @@ function test_start_session_action() { local SESSION_NAME="my_triggered_session" local TRIGGER_NAME="trigger1" - local TRACE_PATH=$(mktemp --tmpdir -d test-start-action-trace.XXXXXX) - local SYNC_AFTER_NOTIF_REGISTER_PATH=$(mktemp --tmpdir -u test-notif-register.XXXXXX) + local TRACE_PATH=$(mktemp -d -t test-start-action-trace.XXXXXX) + local SYNC_AFTER_NOTIF_REGISTER_PATH=$(mktemp -u -t test-notif-register.XXXXXX) diag "Start session action" @@ -95,8 +95,8 @@ function test_stop_session_action() { local SESSION_NAME="my_triggered_session" local TRIGGER_NAME="trigger1" - local TRACE_PATH=$(mktemp --tmpdir -d test-stop-action-trace.XXXXXX) - local SYNC_AFTER_NOTIF_REGISTER_PATH=$(mktemp --tmpdir -u test-notif-register.XXXXXX) + local TRACE_PATH=$(mktemp -d -t test-stop-action-trace.XXXXXX) + local SYNC_AFTER_NOTIF_REGISTER_PATH=$(mktemp -u -t test-notif-register.XXXXXX) diag "Stop session action" create_lttng_session_ok $SESSION_NAME "$TRACE_PATH" diff --git a/tests/regression/tools/trigger/test_add_trigger_cli b/tests/regression/tools/trigger/test_add_trigger_cli index a12e15ce8..52bbe7402 100755 --- a/tests/regression/tools/trigger/test_add_trigger_cli +++ b/tests/regression/tools/trigger/test_add_trigger_cli @@ -30,8 +30,8 @@ FULL_LTTNG_BIN="${TESTDIR}/../src/bin/lttng/${LTTNG_BIN}" # shellcheck disable=SC2119 start_lttng_sessiond_notap -tmp_stdout=$(mktemp --tmpdir -t test_parse_cli_trigger_stdout.XXXXXX) -tmp_stderr=$(mktemp --tmpdir -t test_parse_cli_trigger_stderr.XXXXXX) +tmp_stdout=$(mktemp -t test_parse_cli_trigger_stdout.XXXXXX) +tmp_stderr=$(mktemp -t test_parse_cli_trigger_stderr.XXXXXX) uprobe_elf_binary="${TESTDIR}/utils/testapp/userspace-probe-elf-binary/.libs/userspace-probe-elf-binary" if [ "$(id -u)" == "0" ]; then @@ -86,8 +86,8 @@ function test_mi () # the one used by the list command. Here we simply validate that a # simple trigger is correctly generated. - tmp_stdout_raw=$(mktemp --tmpdir -t "tmp.${FUNCNAME[0]}_stdout.XXXXXX") - tmp_expected_stdout=$(mktemp --tmpdir -t "tmp.${FUNCNAME[0]}_expected_stdout.XXXXXX") + tmp_stdout_raw=$(mktemp -t "tmp.${FUNCNAME[0]}_stdout.XXXXXX") + tmp_expected_stdout=$(mktemp -t "tmp.${FUNCNAME[0]}_expected_stdout.XXXXXX") diag "${FULL_LTTNG_BIN} --mi=xml add-trigger" diff --git a/tests/regression/tools/trigger/test_list_triggers_cli b/tests/regression/tools/trigger/test_list_triggers_cli index a04018013..e6d025078 100755 --- a/tests/regression/tools/trigger/test_list_triggers_cli +++ b/tests/regression/tools/trigger/test_list_triggers_cli @@ -27,10 +27,10 @@ NUM_TESTS=150 FULL_LTTNG_BIN="${TESTDIR}/../src/bin/lttng/${LTTNG_BIN}" -tmp_stdout=$(mktemp --tmpdir -t test_list_triggers_cli_stdout.XXXXXX) -tmp_stderr=$(mktemp --tmpdir -t test_list_triggers_cli_stderr.XXXXXX) -tmp_expected_stdout=$(mktemp --tmpdir -t test_list_triggers_cli_expected_stdout.XXXXXX) -tmp_expected_stdout_mi=$(mktemp --tmpdir -t test_list_triggers_cli_expected_stdout.mi.XXXXXX) +tmp_stdout=$(mktemp -t test_list_triggers_cli_stdout.XXXXXX) +tmp_stderr=$(mktemp -t test_list_triggers_cli_stderr.XXXXXX) +tmp_expected_stdout=$(mktemp -t test_list_triggers_cli_expected_stdout.XXXXXX) +tmp_expected_stdout_mi=$(mktemp -t test_list_triggers_cli_expected_stdout.mi.XXXXXX) uprobe_elf_binary=$(realpath "${TESTDIR}/utils/testapp/userspace-probe-elf-binary/.libs/userspace-probe-elf-binary") uprobe_sdt_binary=$(realpath "${TESTDIR}/utils/testapp/userspace-probe-sdt-binary/.libs/userspace-probe-sdt-binary") register_some_triggers_bin=$(realpath "${CURDIR}/utils/register-some-triggers") diff --git a/tests/regression/tools/trigger/test_remove_trigger_cli b/tests/regression/tools/trigger/test_remove_trigger_cli index aafbe4e24..ded80bb9b 100755 --- a/tests/regression/tools/trigger/test_remove_trigger_cli +++ b/tests/regression/tools/trigger/test_remove_trigger_cli @@ -27,9 +27,9 @@ plan_tests 22 FULL_LTTNG_BIN="${TESTDIR}/../src/bin/lttng/${LTTNG_BIN}" -tmp_stdout=$(mktemp --tmpdir -t test_remove_triggers_cli_stdout.XXXXXX) -tmp_stderr=$(mktemp --tmpdir -t test_remove_triggers_cli_stderr.XXXXXX) -tmp_expected_stdout=$(mktemp --tmpdir -t test_remove_triggers_cli_expected_stdout.XXXXXX) +tmp_stdout=$(mktemp -t test_remove_triggers_cli_stdout.XXXXXX) +tmp_stderr=$(mktemp -t test_remove_triggers_cli_stderr.XXXXXX) +tmp_expected_stdout=$(mktemp -t test_remove_triggers_cli_expected_stdout.XXXXXX) uid=$(id --user) gid=$(id --group) @@ -73,8 +73,8 @@ function test_mi () # the one used by the list command. Here we simply validate that a # simple trigger is correctly generated on removal for MI. - tmp_stdout_raw=$(mktemp --tmpdir -t "tmp.${FUNCNAME[0]}_stdout.XXXXXX") - tmp_expected_stdout=$(mktemp --tmpdir -t "tmp.${FUNCNAME[0]}_expected_stdout.XXXXXX") + tmp_stdout_raw=$(mktemp -t "tmp.${FUNCNAME[0]}_stdout.XXXXXX") + tmp_expected_stdout=$(mktemp -t "tmp.${FUNCNAME[0]}_expected_stdout.XXXXXX") diag "${FULL_LTTNG_BIN} --mi=xml remove-trigger" diff --git a/tests/regression/tools/wildcard/test_event_wildcard b/tests/regression/tools/wildcard/test_event_wildcard index c22646175..36e669b32 100755 --- a/tests/regression/tools/wildcard/test_event_wildcard +++ b/tests/regression/tools/wildcard/test_event_wildcard @@ -35,7 +35,7 @@ function run_kernel function test_event_wildcard() { - TRACE_PATH=$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") DOMAIN="$1" FIND="$2" WILDCARD="$3" @@ -69,7 +69,7 @@ function test_event_wildcard() function test_event_wildcard_fail() { - TRACE_PATH=$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") DOMAIN="$1" WILDCARD="$2" diff --git a/tests/regression/tools/working-directory/test_relayd_working_directory b/tests/regression/tools/working-directory/test_relayd_working_directory index c7e784cca..c196a059e 100755 --- a/tests/regression/tools/working-directory/test_relayd_working_directory +++ b/tests/regression/tools/working-directory/test_relayd_working_directory @@ -22,7 +22,7 @@ print_test_banner "$TEST_DESC" function test_relayd() { local relayd_bin_path="$DIR/../src/bin/lttng-relayd/$RELAYD_BIN" - local working_dir=$(realpath "$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_working_dir.XXXXXX")") + local working_dir=$(realpath "$(mktemp -d -t "tmp.${FUNCNAME[0]}_working_dir.XXXXXX")") local pid local cwd @@ -58,7 +58,7 @@ function test_relayd_daemon() { local cwd local pid - local working_dir=$(realpath "$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_working_dir.XXXXXX")") + local working_dir=$(realpath "$(mktemp -d -t "tmp.${FUNCNAME[0]}_working_dir.XXXXXX")") diag "Test lttng-relayd daemon mode change working directory" @@ -100,7 +100,7 @@ function test_relayd_background() { local cwd local pid - local working_dir=$(realpath "$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_working_dir.XXXXXX")") + local working_dir=$(realpath "$(mktemp -d -t "tmp.${FUNCNAME[0]}_working_dir.XXXXXX")") diag "Test lttng-relayd background mode change working directory" @@ -155,14 +155,14 @@ function test_relayd_debug_permission() local output_pattern='Working directory \".*\" is not writable' local cwd local pid - local working_dir=$(realpath "$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_working_dir.XXXXXX")") + local working_dir=$(realpath "$(mktemp -d -t "tmp.${FUNCNAME[0]}_working_dir.XXXXXX")") # Removing write access to working dir okx chmod -w "$working_dir" # Redirect the error output to a temporary file - ERROR_OUTPUT_DEST=$(mktemp --tmpdir "tmp.${FUNCNAME[0]}_error_output.XXXXXX") + ERROR_OUTPUT_DEST=$(mktemp -t "tmp.${FUNCNAME[0]}_error_output.XXXXXX") start_lttng_relayd_opt 1 "-b" "-v --working-dir $working_dir" pid=$(lttng_pgrep "$RELAYD_MATCH") @@ -185,8 +185,8 @@ function test_relayd_failure() { local output_pattern='Failed to change working directory to' local relayd_bin_path="$DIR/../src/bin/lttng-relayd/$RELAYD_BIN" - local working_dir=$(realpath "$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_working_dir.XXXXXX")") - local output_dest=$(mktemp --tmpdir "tmp.${FUNCNAME[0]}_working_dir.XXXXXX") + local working_dir=$(realpath "$(mktemp -d -t "tmp.${FUNCNAME[0]}_working_dir.XXXXXX")") + local output_dest=$(mktemp -t "tmp.${FUNCNAME[0]}_working_dir.XXXXXX") local working_dir_imaginary local pid @@ -218,7 +218,7 @@ function test_relayd_env() { local cwd local pid - local working_dir=$(realpath "$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_working_dir.XXXXXX")") + local working_dir=$(realpath "$(mktemp -d -t "tmp.${FUNCNAME[0]}_working_dir.XXXXXX")") diag "Test lttng-relayd change working directory from env. variable" @@ -241,8 +241,8 @@ function test_relayd_cmdline_overwrite_env() { local cwd local pid - local working_dir_env=$(realpath "$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_working_dir_even.XXXXXX")") - local working_dir_cmdline=$(realpath "$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_working_dir_cmdline.XXXXXX")") + local working_dir_env=$(realpath "$(mktemp -d -t "tmp.${FUNCNAME[0]}_working_dir_even.XXXXXX")") + local working_dir_cmdline=$(realpath "$(mktemp -d -t "tmp.${FUNCNAME[0]}_working_dir_cmdline.XXXXXX")") diag "Test lttng-relayd change working directory command line overwrite env variable" diff --git a/tests/regression/ust/before-after/test_before_after b/tests/regression/ust/before-after/test_before_after index 0c3ebec54..f7b954779 100755 --- a/tests/regression/ust/before-after/test_before_after +++ b/tests/regression/ust/before-after/test_before_after @@ -47,8 +47,8 @@ function test_before_apps() function test_after_apps() { local out - 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") + local file_sync_after_first=$(mktemp -u -t "tmp.${FUNCNAME[0]}_sync_after_first.XXXXXX") + local file_sync_before_last=$(mktemp -u -t "tmp.${FUNCNAME[0]}_sync_before_last.XXXXXX") create_lttng_session_ok $SESSION_NAME $TRACE_PATH enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME @@ -86,7 +86,7 @@ start_lttng_sessiond diag "Start tracing BEFORE application is started" -TRACE_PATH=$(mktemp --tmpdir -d tmp.test_before_after_ust_trace_path.XXXXXX) +TRACE_PATH=$(mktemp -d -t tmp.test_before_after_ust_trace_path.XXXXXX) test_before_apps out=$? @@ -99,7 +99,7 @@ rm -rf $TRACE_PATH diag "Start tracing AFTER application is started" -TRACE_PATH=$(mktemp --tmpdir -d tmp.test_before_after_ust_trace_path.XXXXXX) +TRACE_PATH=$(mktemp -d -t tmp.test_before_after_ust_trace_path.XXXXXX) test_after_apps out=$? diff --git a/tests/regression/ust/blocking/test_blocking b/tests/regression/ust/blocking/test_blocking index ca8643532..9b36af23f 100755 --- a/tests/regression/ust/blocking/test_blocking +++ b/tests/regression/ust/blocking/test_blocking @@ -148,7 +148,7 @@ i=0 while [ "$i" -lt "$TEST_COUNT" ]; do - TRACE_PATH=$(mktemp --tmpdir -d tmp.test_blocking_ust_trace_path.XXXXXX) + TRACE_PATH=$(mktemp -d -t tmp.test_blocking_ust_trace_path.XXXXXX) # Execute test ${TESTS[$i]} diff --git a/tests/regression/ust/buffers-pid/test_buffers_pid b/tests/regression/ust/buffers-pid/test_buffers_pid index 982ee2d58..9463d1a51 100755 --- a/tests/regression/ust/buffers-pid/test_buffers_pid +++ b/tests/regression/ust/buffers-pid/test_buffers_pid @@ -64,8 +64,8 @@ test_after_multiple_apps() { test_before_multiple_apps() { local out local i - 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") + local file_sync_after_first=$(mktemp -u -t "tmp.${FUNCNAME[0]}_sync_after_first.XXXXXX") + local file_sync_before_last=$(mktemp -u -t "tmp.${FUNCNAME[0]}_sync_before_last.XXXXXX") diag "Start multiple applications BEFORE tracing is started" @@ -137,8 +137,8 @@ test_after_app() { test_before_app() { local out - 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") + local file_sync_after_first=$(mktemp -u -t "tmp.${FUNCNAME[0]}_sync_after_first.XXXXXX") + local file_sync_before_last=$(mktemp -u -t "tmp.${FUNCNAME[0]}_sync_before_last.XXXXXX") diag "Start application BEFORE tracing is started" @@ -238,7 +238,7 @@ i=0 start_lttng_sessiond while [ $i -lt $TEST_COUNT ]; do - TRACE_PATH=$(mktemp --tmpdir -d tmp.test_buffers_pid_trace_path.XXXXXX) + TRACE_PATH=$(mktemp -d -t tmp.test_buffers_pid_trace_path.XXXXXX) ${TESTS[$i]} rm -rf $TRACE_PATH let "i++" diff --git a/tests/regression/ust/clock-override/test_clock_override b/tests/regression/ust/clock-override/test_clock_override index 6be2d8dff..c7157720e 100755 --- a/tests/regression/ust/clock-override/test_clock_override +++ b/tests/regression/ust/clock-override/test_clock_override @@ -66,8 +66,8 @@ function extract_clock_metadata_token() function test_getcpu_override_metadata() { - local ctf_metadata_file=$(mktemp --tmpdir -p $TRACE_PATH ctf-metadata.XXXXXX) - local clock_metadata_file=$(mktemp --tmpdir -p $TRACE_PATH clock-metadata.XXXXXX) + local ctf_metadata_file=$(TMPDIR="$TRACE_PATH" mktemp -t ctf-metadata.XXXXXX) + local clock_metadata_file=$(TMPDIR="$TRACE_PATH" mktemp -t clock-metadata.XXXXXX) local result="" diag "Clock override plugin metadata test" @@ -174,7 +174,7 @@ i=0 while [ "$i" -lt "$TEST_COUNT" ]; do - TRACE_PATH=$(mktemp --tmpdir -d tmp.test_clock_override_ust_trace_path.XXXXXX) + TRACE_PATH=$(mktemp -d -t tmp.test_clock_override_ust_trace_path.XXXXXX) # Execute test ${TESTS[$i]} diff --git a/tests/regression/ust/getcpu-override/test_getcpu_override b/tests/regression/ust/getcpu-override/test_getcpu_override index 124219a36..7723a7679 100755 --- a/tests/regression/ust/getcpu-override/test_getcpu_override +++ b/tests/regression/ust/getcpu-override/test_getcpu_override @@ -175,7 +175,7 @@ start_lttng_sessiond for fct_test in ${TESTS[@]}; do - TRACE_PATH=$(mktemp --tmpdir -d tmp.test_getcpu_override_trace_path.XXXXXX) + TRACE_PATH=$(mktemp -d -t tmp.test_getcpu_override_trace_path.XXXXXX) ${fct_test} if [ $? -ne 0 ]; then diff --git a/tests/regression/ust/high-throughput/test_high_throughput b/tests/regression/ust/high-throughput/test_high_throughput index 873646fa9..9f59836c2 100755 --- a/tests/regression/ust/high-throughput/test_high_throughput +++ b/tests/regression/ust/high-throughput/test_high_throughput @@ -20,7 +20,7 @@ if [ ! -x "$CURDIR/$BIN_NAME" ]; then BAIL_OUT "No UST nevents binary detected." fi -TRACE_PATH=$(mktemp --tmpdir -d tmp.test_high_throughput_ust_trace_path.XXXXXX) +TRACE_PATH=$(mktemp -d -t tmp.test_high_throughput_ust_trace_path.XXXXXX) # MUST set TESTDIR before calling those functions @@ -52,8 +52,8 @@ stop_lttng_sessiond # Validate test -TEMP_FILE=$(mktemp --tmpdir tmp.test_high_throughput_tmp_file1.XXXXXX) -TEMP_FILE_2=$(mktemp --tmpdir tmp.test_high_throughput_tmp_file2.XXXXXX) +TEMP_FILE=$(mktemp -t tmp.test_high_throughput_tmp_file1.XXXXXX) +TEMP_FILE_2=$(mktemp -t tmp.test_high_throughput_tmp_file2.XXXXXX) traced=$("$BABELTRACE_BIN" $TRACE_PATH 2>/dev/null | wc -l) "$BABELTRACE_BIN" $TRACE_PATH >/dev/null 2>$TEMP_FILE_2 diff --git a/tests/regression/ust/java-jul/test_java_jul b/tests/regression/ust/java-jul/test_java_jul index 90c1758e1..41e2656ff 100755 --- a/tests/regression/ust/java-jul/test_java_jul +++ b/tests/regression/ust/java-jul/test_java_jul @@ -79,8 +79,8 @@ function enable_jul_filter_loglevel_only() function test_jul_before_start () { - 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") + local file_sync_after_first=$(mktemp -u -t "tmp.${FUNCNAME[0]}_sync_after_first.XXXXXX") + local file_sync_before_last=$(mktemp -u -t "tmp.${FUNCNAME[0]}_sync_before_last.XXXXXX") diag "Test JUL application BEFORE tracing starts" create_lttng_session_ok $SESSION_NAME $TRACE_PATH @@ -696,7 +696,7 @@ skip $withapp "JUL support is needed. Skipping all tests." $NUM_TESTS || for fct_test in ${tests[@]}; do - TRACE_PATH=$(mktemp --tmpdir -d tmp.test_java_jul_trace_path.XXXXXX) + TRACE_PATH=$(mktemp -d -t tmp.test_java_jul_trace_path.XXXXXX) ${fct_test} if [ $? -ne 0 ]; then diff --git a/tests/regression/ust/java-log4j/test_java_log4j b/tests/regression/ust/java-log4j/test_java_log4j index 825889f52..556d473b4 100755 --- a/tests/regression/ust/java-log4j/test_java_log4j +++ b/tests/regression/ust/java-log4j/test_java_log4j @@ -57,8 +57,8 @@ function test_log4j_before_start () local file_sync_after_first local file_sync_before_last - file_sync_after_first=$(mktemp --tmpdir -u "tmp.${FUNCNAME[0]}_sync_after_first.XXXXXX") - file_sync_before_last=$(mktemp --tmpdir -u "tmp.${FUNCNAME[0]}_sync_before_last.XXXXXX") + file_sync_after_first=$(mktemp -u -t "tmp.${FUNCNAME[0]}_sync_after_first.XXXXXX") + file_sync_before_last=$(mktemp -u -t "tmp.${FUNCNAME[0]}_sync_before_last.XXXXXX") diag "Test LOG4J application BEFORE tracing starts" create_lttng_session_ok $SESSION_NAME "$TRACE_PATH" @@ -579,7 +579,7 @@ tests=( for fct_test in "${tests[@]}"; do - TRACE_PATH=$(mktemp --tmpdir -d tmp.test_java_log4j_trace_path.XXXXXX) + TRACE_PATH=$(mktemp -d -t tmp.test_java_log4j_trace_path.XXXXXX) ${fct_test} diff --git a/tests/regression/ust/java-log4j2/test_agent_log4j2_domain_log4j b/tests/regression/ust/java-log4j2/test_agent_log4j2_domain_log4j index 11091f545..55960be87 100755 --- a/tests/regression/ust/java-log4j2/test_agent_log4j2_domain_log4j +++ b/tests/regression/ust/java-log4j2/test_agent_log4j2_domain_log4j @@ -58,8 +58,8 @@ function test_log4j2_before_start () local file_sync_after_first local file_sync_before_last - file_sync_after_first=$(mktemp --tmpdir -u "tmp.${FUNCNAME[0]}_sync_after_first.XXXXXX") - file_sync_before_last=$(mktemp --tmpdir -u "tmp.${FUNCNAME[0]}_sync_before_last.XXXXXX") + file_sync_after_first=$(mktemp -u -t "tmp.${FUNCNAME[0]}_sync_after_first.XXXXXX") + file_sync_before_last=$(mktemp -u -t "tmp.${FUNCNAME[0]}_sync_before_last.XXXXXX") diag "Test LOG4J2 application BEFORE tracing starts" create_lttng_session_ok "log4j2_before_start" "$TRACE_PATH" @@ -580,7 +580,7 @@ tests=( for fct_test in "${tests[@]}"; do - TRACE_PATH=$(mktemp --tmpdir -d tmp.test_java_log4j2_trace_path.XXXXXX) + TRACE_PATH=$(mktemp -d -t tmp.test_java_log4j2_trace_path.XXXXXX) ${fct_test} diff --git a/tests/regression/ust/low-throughput/test_low_throughput b/tests/regression/ust/low-throughput/test_low_throughput index e03d9f01e..2861324f2 100755 --- a/tests/regression/ust/low-throughput/test_low_throughput +++ b/tests/regression/ust/low-throughput/test_low_throughput @@ -19,7 +19,7 @@ if [ ! -x "$CURDIR/$BIN_NAME" ]; then BAIL_OUT "No UST nevents binary detected." fi -TRACE_PATH=$(mktemp --tmpdir -d tmp.test_low_throughput_ust_trace_path.XXXXXX) +TRACE_PATH=$(mktemp -d -t tmp.test_low_throughput_ust_trace_path.XXXXXX) # MUST set TESTDIR before calling those functions diff --git a/tests/regression/ust/multi-lib/test_multi_lib b/tests/regression/ust/multi-lib/test_multi_lib index 071d8e530..4a96dd032 100755 --- a/tests/regression/ust/multi-lib/test_multi_lib +++ b/tests/regression/ust/multi-lib/test_multi_lib @@ -236,7 +236,7 @@ start_lttng_sessiond while [ "$i" -lt "$TEST_COUNT" ]; do - TRACE_PATH=$(mktemp --tmpdir -d tmp.test_multi_lib_ust_trace_path.XXXXXX) + TRACE_PATH=$(mktemp -d -t tmp.test_multi_lib_ust_trace_path.XXXXXX) create_lttng_session_ok $SESSION_NAME $TRACE_PATH diff --git a/tests/regression/ust/multi-session/test_multi_session b/tests/regression/ust/multi-session/test_multi_session index 91f064dae..c0d1c307e 100755 --- a/tests/regression/ust/multi-session/test_multi_session +++ b/tests/regression/ust/multi-session/test_multi_session @@ -65,7 +65,7 @@ print_test_banner "$TEST_DESC" start_lttng_sessiond -TRACE_PATH=$(mktemp --tmpdir -d tmp.test_multi_session_ust.XXXXXX) +TRACE_PATH=$(mktemp -d -t tmp.test_multi_session_ust.XXXXXX) test_multi_session out=$? diff --git a/tests/regression/ust/namespaces/test_ns_contexts b/tests/regression/ust/namespaces/test_ns_contexts index e65cc2475..0af3193ef 100755 --- a/tests/regression/ust/namespaces/test_ns_contexts +++ b/tests/regression/ust/namespaces/test_ns_contexts @@ -44,7 +44,7 @@ function test_ns() return fi - trace_path=$(mktemp --tmpdir -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + trace_path=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") # Get the current ns inode number ns_inode=$(stat -c '%i' -L "/proc/$$/ns/$ns") diff --git a/tests/regression/ust/namespaces/test_ns_contexts_change b/tests/regression/ust/namespaces/test_ns_contexts_change index 78fc37b5d..fd1621630 100755 --- a/tests/regression/ust/namespaces/test_ns_contexts_change +++ b/tests/regression/ust/namespaces/test_ns_contexts_change @@ -46,9 +46,9 @@ function test_ns() ns_inode=$(stat -c '%i' -L "/proc/$$/ns/$ns") ok $? "Get current $ns namespace inode: $ns_inode" || ns_inode="invalid" - trace_path=$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") - file_sync_before_last=$(mktemp --tmpdir -u "tmp.${FUNCNAME[0]}_sync_before_last.XXXXXX") - file_sync_after_unshare=$(mktemp --tmpdir -u "tmp.${FUNCNAME[0]}_sync_after_unshare.XXXXXX") + trace_path=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + file_sync_before_last=$(mktemp -u -t "tmp.${FUNCNAME[0]}_sync_before_last.XXXXXX") + file_sync_after_unshare=$(mktemp -u -t "tmp.${FUNCNAME[0]}_sync_after_unshare.XXXXXX") start_lttng_sessiond diff --git a/tests/regression/ust/nprocesses/test_nprocesses b/tests/regression/ust/nprocesses/test_nprocesses index 7673370ce..5e16164e5 100755 --- a/tests/regression/ust/nprocesses/test_nprocesses +++ b/tests/regression/ust/nprocesses/test_nprocesses @@ -36,8 +36,8 @@ start_lttng_sessiond # Start tests. Each is an infinite tracing loop. -file_sync_after_first=$(mktemp --tmpdir -u tmp.test_nprocesses_sync_after_first.XXXXXX) -file_sync_before_last=$(mktemp --tmpdir -u tmp.test_nprocesses_sync_before_last.XXXXXX) +file_sync_after_first=$(mktemp -u -t tmp.test_nprocesses_sync_after_first.XXXXXX) +file_sync_before_last=$(mktemp -u -t tmp.test_nprocesses_sync_before_last.XXXXXX) diag "Starting $NUM_PROCESS test applications" for i in `seq 1 $NUM_PROCESS` @@ -58,7 +58,7 @@ done pass "All applications are registered to sessiond" -TRACE_PATH=$(mktemp --tmpdir -d tmp.test_nprocesses_trace_path.XXXXXX) +TRACE_PATH=$(mktemp -d -t tmp.test_nprocesses_trace_path.XXXXXX) create_lttng_session_ok $SESSION_NAME $TRACE_PATH diff --git a/tests/regression/ust/overlap/test_overlap b/tests/regression/ust/overlap/test_overlap index a942d066a..8eddc8247 100755 --- a/tests/regression/ust/overlap/test_overlap +++ b/tests/regression/ust/overlap/test_overlap @@ -645,7 +645,7 @@ start_lttng_sessiond while [ "$i" -lt "$TEST_COUNT" ]; do - TRACE_PATH=$(mktemp --tmpdir -d -t tmp.test_overlap.XXXXXX) + TRACE_PATH=$(mktemp -d -t tmp.test_overlap.XXXXXX) create_lttng_session_ok $SESSION_NAME $TRACE_PATH diff --git a/tests/regression/ust/periodical-metadata-flush/test_periodical_metadata_flush b/tests/regression/ust/periodical-metadata-flush/test_periodical_metadata_flush index d81d475d4..56c23ff40 100755 --- a/tests/regression/ust/periodical-metadata-flush/test_periodical_metadata_flush +++ b/tests/regression/ust/periodical-metadata-flush/test_periodical_metadata_flush @@ -17,7 +17,7 @@ SESSION_NAME="periodical-flush" EVENT_NAME="tp:tptest" BIN_NAME="gen-nevents" NUM_TESTS=38 -APP_TMP_FILE=$(mktemp --tmpdir -u tmp.test_periodical_metadata_flush_ust_app_tmp_file.XXXXXX) +APP_TMP_FILE=$(mktemp -u -t tmp.test_periodical_metadata_flush_ust_app_tmp_file.XXXXXX) APPS_PID= source $TESTDIR/utils/utils.sh @@ -313,7 +313,7 @@ i=0 start_lttng_sessiond while [ $i -lt $TEST_COUNT ]; do - TRACE_PATH=$(mktemp --tmpdir -d tmp.test_periodical_metadata_flush_ust_trace_path.XXXXXX) + TRACE_PATH=$(mktemp -d -t tmp.test_periodical_metadata_flush_ust_trace_path.XXXXXX) ${TESTS[$i]} rm -rf $TRACE_PATH let "i++" diff --git a/tests/regression/ust/python-logging/test_python_logging.in b/tests/regression/ust/python-logging/test_python_logging.in index 470452260..0bb7ef24d 100755 --- a/tests/regression/ust/python-logging/test_python_logging.in +++ b/tests/regression/ust/python-logging/test_python_logging.in @@ -106,8 +106,8 @@ function enable_python_filter_loglevel_only() function test_python_before_start () { - local ready_file=$(mktemp --tmpdir -u) - local go_file=$(mktemp --tmpdir -u) + local ready_file=$(mktemp -u -t) + local go_file=$(mktemp -u -t) diag "Test Python application BEFORE tracing starts" create_lttng_session_ok $SESSION_NAME $TRACE_PATH @@ -688,7 +688,7 @@ function test_python_filter_loglevel() function test_python_trigger_notify_action { uid=$(id --user) - tmp_expected_stdout=$(mktemp --tmpdir -t test_list_triggers_python_cli_expected_stdout.XXXXXX) + tmp_expected_stdout=$(mktemp -t test_list_triggers_python_cli_expected_stdout.XXXXXX) diag "Test Python trigger with notify action" @@ -754,7 +754,7 @@ skip $skip_agent "Python agent test skipped." $NUM_TESTS || do for fct_test in ${tests[@]}; do - TRACE_PATH=$(mktemp --tmpdir -d tmp.test_python_logging_trace_path.XXXXXX) + TRACE_PATH=$(mktemp -d -t tmp.test_python_logging_trace_path.XXXXXX) diag "(Python $python_version)" ${fct_test} $python_version diff --git a/tests/regression/ust/rotation-destroy-flush/test_rotation_destroy_flush b/tests/regression/ust/rotation-destroy-flush/test_rotation_destroy_flush index 8ef4f0d8c..669bcbc43 100755 --- a/tests/regression/ust/rotation-destroy-flush/test_rotation_destroy_flush +++ b/tests/regression/ust/rotation-destroy-flush/test_rotation_destroy_flush @@ -130,7 +130,7 @@ while [ "$i" -lt "$TEST_COUNT" ]; do trap signal_cleanup SIGTERM SIGINT - TRACE_PATH=$(mktemp --tmpdir -d -t tmp.test_rotation_destroy_flush.XXXXXX) + TRACE_PATH=$(mktemp -d -t tmp.test_rotation_destroy_flush.XXXXXX) # Execute test ${TESTS[$i]} diff --git a/tests/regression/ust/test_event_basic b/tests/regression/ust/test_event_basic index dd0c77145..1e4e67f61 100755 --- a/tests/regression/ust/test_event_basic +++ b/tests/regression/ust/test_event_basic @@ -19,7 +19,7 @@ source $TESTDIR/utils/utils.sh function test_event_basic() { - TRACE_PATH=$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") SESSION_NAME="ust_event_basic" SESSION_NAME2="ust_event_basic2" CHAN_NAME="mychan" diff --git a/tests/regression/ust/test_event_perf b/tests/regression/ust/test_event_perf index 01c137a19..9b2de4de2 100755 --- a/tests/regression/ust/test_event_perf +++ b/tests/regression/ust/test_event_perf @@ -56,7 +56,7 @@ function add_context_ust_skip_ok() # Only test parsing of the enabling by raw ID function test_parsing_raw() { - TRACE_PATH=$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") SESSION_NAME="ust_event_basic" CHAN_NAME="mychan" @@ -84,7 +84,7 @@ function test_parsing_raw() function test_event_basic() { - TRACE_PATH=$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") + TRACE_PATH=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX") SESSION_NAME="ust_event_basic" CHAN_NAME="mychan" diff --git a/tests/regression/ust/test_event_tracef b/tests/regression/ust/test_event_tracef index 2d7a64154..30922a6cf 100755 --- a/tests/regression/ust/test_event_tracef +++ b/tests/regression/ust/test_event_tracef @@ -49,7 +49,7 @@ bail_out_if_no_babeltrace start_lttng_sessiond -TRACE_PATH=$(mktemp --tmpdir -d tmp.test_event_tracef_trace_path.XXXXXX) +TRACE_PATH=$(mktemp -d -t tmp.test_event_tracef_trace_path.XXXXXX) test_event_tracef out=$? if [ $out -ne 0 ]; then diff --git a/tests/stress/test_multi_sessions_per_uid_10app b/tests/stress/test_multi_sessions_per_uid_10app index 26565464a..68cfc4572 100755 --- a/tests/stress/test_multi_sessions_per_uid_10app +++ b/tests/stress/test_multi_sessions_per_uid_10app @@ -126,7 +126,7 @@ diag "Starting applications" ./$TESTDIR/stress/$LAUNCH_APP $NR_APP & APPS_PID="${APPS_PID} ${!}" -TRACE_PATH=$(mktemp --tmpdir -d -t tmp.test_multi_sess_per_uid_10app.XXXXXX) +TRACE_PATH=$(mktemp -d -t tmp.test_multi_sess_per_uid_10app.XXXXXX) test_stress out=$? diff --git a/tests/stress/test_multi_sessions_per_uid_5app_streaming b/tests/stress/test_multi_sessions_per_uid_5app_streaming index db225db0e..d1d192c02 100755 --- a/tests/stress/test_multi_sessions_per_uid_5app_streaming +++ b/tests/stress/test_multi_sessions_per_uid_5app_streaming @@ -150,7 +150,7 @@ plan_tests $NUM_TESTS print_test_banner "$TEST_DESC" -TRACE_PATH=$(mktemp --tmpdir -d -t tmp.test_multi_sess_per_uid_5app_streaming.XXXXXX) +TRACE_PATH=$(mktemp -d -t tmp.test_multi_sess_per_uid_5app_streaming.XXXXXX) start_relayd "-o $TRACE_PATH" start_sessiond diff --git a/tests/stress/test_multi_sessions_per_uid_5app_streaming_kill_relayd b/tests/stress/test_multi_sessions_per_uid_5app_streaming_kill_relayd index 9cb664d5b..53411cb6d 100755 --- a/tests/stress/test_multi_sessions_per_uid_5app_streaming_kill_relayd +++ b/tests/stress/test_multi_sessions_per_uid_5app_streaming_kill_relayd @@ -152,7 +152,7 @@ plan_tests $NUM_TESTS print_test_banner "$TEST_DESC" -TRACE_PATH=$(mktemp --tmpdir -d -t tmp.test_multi_sess_per_uid_5app_kill_relayd.XXXXXX) +TRACE_PATH=$(mktemp -d -t tmp.test_multi_sess_per_uid_5app_kill_relayd.XXXXXX) start_relayd "-o $TRACE_PATH" start_sessiond diff --git a/tests/utils/utils.sh b/tests/utils/utils.sh index 1428afd62..b33a264c2 100644 --- a/tests/utils/utils.sh +++ b/tests/utils/utils.sh @@ -2376,8 +2376,8 @@ function lttng_remove_trigger_ok() function list_triggers_matches_ok () { - local tmp_stdout=$(mktemp --tmpdir -t "tmp.${FUNCNAME[0]}_stdout.XXXXXX") - local tmp_stderr=$(mktemp --tmpdir -t "tmp.${FUNCNAME[0]}_stderr.XXXXXX") + local tmp_stdout=$(mktemp -t "tmp.${FUNCNAME[0]}_stdout.XXXXXX") + local tmp_stderr=$(mktemp -t "tmp.${FUNCNAME[0]}_stderr.XXXXXX") local test_name="$1" local expected_stdout_file="$2" @@ -2406,9 +2406,9 @@ function list_triggers_matches_mi_ok () local test_name="$1" local expected_stdout_file="$2" - tmp_stdout_raw=$(mktemp --tmpdir -t "tmp.${FUNCNAME[0]}_stdout.XXXXXX") - tmp_stdout=$(mktemp --tmpdir -t "tmp.${FUNCNAME[0]}_stdout.XXXXXX") - tmp_stderr=$(mktemp --tmpdir -t "tmp.${FUNCNAME[0]}_stderr.XXXXXX") + tmp_stdout_raw=$(mktemp -t "tmp.${FUNCNAME[0]}_stdout.XXXXXX") + tmp_stdout=$(mktemp -t "tmp.${FUNCNAME[0]}_stdout.XXXXXX") + tmp_stderr=$(mktemp -t "tmp.${FUNCNAME[0]}_stderr.XXXXXX") diag "$TESTDIR/../src/bin/lttng/$LTTNG_BIN --mi xml list-triggers" -- 2.34.1