Fix: Tests: leftover temporary files after tests
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Fri, 14 May 2021 19:45:15 +0000 (15:45 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 14 May 2021 23:51:03 +0000 (19:51 -0400)
Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: Ie0c66d45a00e890c1f1e8dc8db7b1baa2cca50f1

tests/regression/tools/clear/test_ust
tests/regression/tools/mi/test_mi
tests/regression/tools/notification/test_notification_ust_capture
tests/regression/tools/notification/test_notification_ust_error
tests/regression/tools/rotation/test_save_load_mi
tests/regression/tools/working-directory/test_relayd_working_directory

index 3983d121533d4ff5d837c7c0fbf028296f709821..32bffbe0ae43bf2fb3be7ebfadc63b04a68dfd75 100755 (executable)
@@ -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 ()
index af7ca765894b06c2a7756c5a8139d1e7e8241c81..46a9e91808c87bf2a628033b8c0c4c7615fae79b 100755 (executable)
@@ -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
index 5003c28946aa1ce28a85779b07beba885286e604..820116ac1377aa5aae9c36bcaf7f972053e4b1db 100755 (executable)
@@ -38,3 +38,5 @@ start_lttng_sessiond_notap
 test_basic_error_path
 
 stop_lttng_sessiond_notap
+
+rm -rf "$TMPDIR"
index 57de30df852cb9a98011b64fe2f5d296d96acd5b..c62fe55eb5be9fd998b77797337219c3f5857b51 100755 (executable)
@@ -37,3 +37,5 @@ start_lttng_sessiond_notap
 test_basic_error_path
 
 stop_lttng_sessiond_notap
+
+rm -rf "$TMPDIR"
index 92146afebef1a0bd5544bb994e17161d21e46ab9..24e1efc67be76db71536ca9236481bdebd6f7ad1 100755 (executable)
@@ -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
index 24b87a9cc1eb15003e72232778dc4d9bc656aa26..58f00496fbba169d0da189746a7b4c059487c2f3 100755 (executable)
@@ -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"
This page took 0.029616 seconds and 5 git commands to generate.