From: Francis Deslauriers Date: Fri, 14 May 2021 19:45:15 +0000 (-0400) Subject: Fix: Tests: leftover temporary files after tests X-Git-Tag: v2.13.0-rc2~2 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=c3527cb10a8f061b1c528cbbd82b58c02d175901;p=lttng-tools.git Fix: Tests: leftover temporary files after tests Signed-off-by: Francis Deslauriers Signed-off-by: Jérémie Galarneau Change-Id: Ie0c66d45a00e890c1f1e8dc8db7b1baa2cca50f1 --- diff --git a/tests/regression/tools/clear/test_ust b/tests/regression/tools/clear/test_ust index 3983d1215..32bffbe0a 100755 --- a/tests/regression/tools/clear/test_ust +++ b/tests/regression/tools/clear/test_ust @@ -296,7 +296,7 @@ function test_ust_streaming_live_viewer () local local_path="${TRACE_PATH}/${HOSTNAME}/${SESSION_NAME}*" local remote_trace_path="${HOSTNAME}/${SESSION_NAME}" local channel_name="chan" - local bt_output_path=$(mktemp -d)/bt-output.txt + local bt_output_path=$(mktemp -t tmp.test_ust_streaming_live_viewer_bt_output.XXXXXX) diag "Test ust streaming live clear with viewer" diag "Parameters: tracing_active=$tracing_active, clear_twice=$clear_twice, buffer_type=$buffer_type" @@ -335,13 +335,10 @@ function test_ust_streaming_live_viewer_new_metadata_after_clear () local local_path="${TRACE_PATH}/${HOSTNAME}/${SESSION_NAME}*" local remote_trace_path="${HOSTNAME}/${SESSION_NAME}" local channel_name="chan" - local bt_output_path - local bt_error_path - local file_sync_before_exit - bt_output_path=$(mktemp -d)/bt-output.txt - bt_error_path=$(mktemp -d)/bt-output.err - file_sync_before_exit=$(mktemp -u) + local bt_output_path=$(mktemp -t tmp.test_ust_streaming_live_viewer_new_metadata_after_clear_bt_output.XXXXXX) + local bt_error_path=$(mktemp -t tmp.test_ust_streaming_live_viewer_new_metadata_after_clear_bt_error.XXXXXX) + local file_sync_before_exit=$(mktemp -u -t tmp.test_ust_streaming_live_viewer_new_metadata_after_clear_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" @@ -411,6 +408,7 @@ function test_ust_streaming_live_viewer_new_metadata_after_clear () clean_path "$bt_output_path" clean_path "$bt_error_path" + rm -f "$file_sync_before_exit" } function test_ust_local () diff --git a/tests/regression/tools/mi/test_mi b/tests/regression/tools/mi/test_mi index af7ca7658..46a9e9180 100755 --- a/tests/regression/tools/mi/test_mi +++ b/tests/regression/tools/mi/test_mi @@ -958,7 +958,7 @@ do fi done rm -rf $OUTPUT_DIR -rm -rf $FOO_LOAD_DIR +rm -rf $SESSIOND_LOAD_DIR OUTPUT_DEST=/dev/null 2>&1 stop_lttng_sessiond diff --git a/tests/regression/tools/notification/test_notification_ust_capture b/tests/regression/tools/notification/test_notification_ust_capture index 5003c2894..820116ac1 100755 --- a/tests/regression/tools/notification/test_notification_ust_capture +++ b/tests/regression/tools/notification/test_notification_ust_capture @@ -38,3 +38,5 @@ start_lttng_sessiond_notap test_basic_error_path stop_lttng_sessiond_notap + +rm -rf "$TMPDIR" diff --git a/tests/regression/tools/notification/test_notification_ust_error b/tests/regression/tools/notification/test_notification_ust_error index 57de30df8..c62fe55eb 100755 --- a/tests/regression/tools/notification/test_notification_ust_error +++ b/tests/regression/tools/notification/test_notification_ust_error @@ -37,3 +37,5 @@ start_lttng_sessiond_notap test_basic_error_path stop_lttng_sessiond_notap + +rm -rf "$TMPDIR" diff --git a/tests/regression/tools/rotation/test_save_load_mi b/tests/regression/tools/rotation/test_save_load_mi index 92146afeb..24e1efc67 100755 --- a/tests/regression/tools/rotation/test_save_load_mi +++ b/tests/regression/tools/rotation/test_save_load_mi @@ -33,9 +33,9 @@ XPATH_LIST_ROTATE_SIZE="$XPATH_SESSION/lttng:rotation_schedules/lttng:size_thres function test_save_load_mi () { - tmp_xml_output=$(mktemp -u) - tmp_save_output=$(mktemp -d) - trace_path=$(mktemp -d) + local tmp_xml_output=$(mktemp -u) + local tmp_save_output=$(mktemp -d) + local trace_path=$(mktemp -d) diag "Test save/load/list/MI with rotation" create_lttng_session_ok $SESSION_NAME $trace_path @@ -76,9 +76,9 @@ function test_save_load_mi () # save, destroy and reload the same session OUTPUT_DEST=/dev/null - lttng_save $SESSION_NAME "-o $tmp_save_output$SESSION_NAME" + lttng_save $SESSION_NAME "-o $tmp_save_output/$SESSION_NAME" destroy_lttng_session_ok $SESSION_NAME - lttng_load_ok "-i $tmp_save_output$SESSION_NAME" + lttng_load_ok "-i $tmp_save_output/$SESSION_NAME" OUTPUT_DEST=${tmp_xml_output} # Check the output of lttng list with the 2 rotation parameters after the load @@ -97,9 +97,9 @@ function test_save_load_mi () OUTPUT_DEST=/dev/null destroy_lttng_session_ok $SESSION_NAME - rm -rf ${trace_path} - rm $tmp_xml_output - rm -rf $tmp_save_output + rm -rf "$trace_path" + rm "$tmp_xml_output" + rm -rf "$tmp_save_output" } plan_tests $NUM_TESTS diff --git a/tests/regression/tools/working-directory/test_relayd_working_directory b/tests/regression/tools/working-directory/test_relayd_working_directory index 24b87a9cc..58f00496f 100755 --- a/tests/regression/tools/working-directory/test_relayd_working_directory +++ b/tests/regression/tools/working-directory/test_relayd_working_directory @@ -229,7 +229,6 @@ function test_relayd_env() local cwd local pid - working_dir=$(mktemp -d) working_dir=$(realpath "$(mktemp -d)") diag "Test lttng-relayd change working directory from env. variable"