X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=tests%2Fregression%2Ftools%2Fclear%2Ftest_ust;h=27af7becac06987a5eb149494ade2cbb167f497d;hb=becd029c4fda2dc6478751f4d45fa6b68a1d6120;hp=81ccb000685c97b352e8cae28661880042ee3b57;hpb=33e557114a2ba28e26e220a833e8a449c78b8b65;p=lttng-tools.git diff --git a/tests/regression/tools/clear/test_ust b/tests/regression/tools/clear/test_ust index 81ccb0006..27af7beca 100755 --- a/tests/regression/tools/clear/test_ust +++ b/tests/regression/tools/clear/test_ust @@ -19,9 +19,10 @@ 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 +# shellcheck source=../utils/utils.sh +source "$TESTDIR/utils/utils.sh" if [ ! -x "$TESTAPP_BIN" ]; then BAIL_OUT "No UST events binary detected." @@ -244,8 +245,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 +297,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 +337,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 +618,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" @@ -636,6 +637,7 @@ function test_ust_local_snapshot_per_pid () --sync-before-last-event-touch ${file_sync_before_last_touch} \ --sync-before-exit ${file_sync_before_exit} \ --sync-before-exit-touch ${file_sync_before_exit_touch} >/dev/null 2>&1 & + local app_pid="${!}" # Continue only when there is only the last event remaining. while [ ! -f "${file_sync_before_last_touch}" ]; do @@ -679,7 +681,7 @@ function test_ust_local_snapshot_per_pid () # Release the application. touch ${file_sync_before_exit} - wait + wait "${app_pid}" destroy_lttng_session_ok $SESSION_NAME rm -f ${file_sync_before_last} @@ -752,7 +754,7 @@ function test_ust_streaming_tracefile_rotation_overwrite_files () --tracefile-size=$PAGE_SIZE --tracefile-count=2 --buffers-$buffer_type enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME $channel_name start_lttng_tracing_ok $SESSION_NAME - taskset -c 0 $TESTAPP_BIN -i 200000 + taskset -c "$(get_any_available_cpu)" $TESTAPP_BIN -i 200000 do_clear_session $SESSION_NAME $tracing_active $clear_twice $rotate_before $rotate_after stop_lttng_tracing_ok $SESSION_NAME @@ -767,7 +769,7 @@ function test_ust_streaming_tracefile_rotation_overwrite_files () fi start_lttng_tracing_ok $SESSION_NAME - taskset -c 0 $TESTAPP_BIN -i 400000 + taskset -c "$(get_any_available_cpu)" $TESTAPP_BIN -i 400000 stop_lttng_tracing_ok if [[ $rotate_before -eq 1 ]]; then @@ -803,6 +805,8 @@ plan_tests $NUM_TESTS print_test_banner "$TEST_DESC" +bail_out_if_no_babeltrace + streaming_tests=(test_ust_streaming test_ust_streaming_rotate_clear test_ust_streaming_clear_rotate @@ -937,3 +941,5 @@ stop_lttng_sessiond stop_lttng_relayd test_ust_disallow_clear + +rm -rf "$TRACE_PATH"