Use '-t' which is portable instead of the GNU specific '--tmpdir'.
Change-Id: I430af6b96c27c2766a2cc4b5574af8563297d717
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
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"
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
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
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
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
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
# 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
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"
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.
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"
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"
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"
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]}
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
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
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"
{
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
{
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
{
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
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
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")
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]}
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
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
{
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"
{
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"
{
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"
{
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"
{
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"
{
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"
{
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"
{
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"
{
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"
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
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"
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"
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"
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"
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"
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"
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"
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"
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"
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"
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"
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"
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"
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"
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"
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"
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"
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"
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"
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"
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"
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"
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"
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"
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"
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:"
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"
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"
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.
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"
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"
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"
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"
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"
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"
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"
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
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
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"
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"
# 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"
# 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"
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"
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"
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"
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"
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"
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"
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"
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"
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"
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"
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"
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
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"
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
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"
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"
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
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"
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"
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"
# 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"
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=
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 &
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
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
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
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"
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
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
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
# 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
{
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
{
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
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
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
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"
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
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
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)
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)
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)
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)
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"
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)
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"
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
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"
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
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"
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"
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"
{
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"
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"
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"
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
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
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
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
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
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
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
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
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=""
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
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
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"
{
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 \
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
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
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"
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
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"
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"
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"
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
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
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
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"
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"
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
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
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
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
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
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"
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
# 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 &
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
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 &
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
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
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
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
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
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
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)
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"
{
# 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"
# 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" \
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=$!
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"
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"
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"
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"
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"
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"
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"
{
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"
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"
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"
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"
{
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"
{
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"
# 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
# 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"
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")
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)
# 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"
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"
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"
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
{
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"
{
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"
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")
{
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
{
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"
{
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"
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
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=$?
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=$?
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]}
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"
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"
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++"
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"
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]}
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
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
# 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
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
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
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"
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}
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"
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}
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
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
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=$?
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")
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
# 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`
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
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
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
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++"
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
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"
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
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]}
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"
# 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"
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"
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
./$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=$?
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
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
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"
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"