Cleanup: tests: name all temporary files to better identify leakage
[lttng-tools.git] / tests / regression / tools / tracefile-limits / test_tracefile_size
index c07972b77f2cba31b3e4e2601d92496370adc1f1..bbfc27c9e01ff25c383f8787a0879ce34b3d47be 100755 (executable)
@@ -84,11 +84,11 @@ function check_file_size ()
 
 function test_tracefile_size_limit ()
 {
-       size_limit="$1"
-       trace_path=$(mktemp -d)
-       session_name=$(randstring 16 0)
-       channel_name="channel"
-       event_name="tp:tptest"
+       local size_limit="$1"
+       local trace_path=$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_trace_path.XXXXXX")
+       local session_name=$(randstring 16 0)
+       local channel_name="channel"
+       local event_name="tp:tptest"
 
        diag "Test tracefile size limit : $size_limit bytes"
 
@@ -115,7 +115,7 @@ function test_tracefile_size_limit ()
 
        # Validate tracing data, we should at least have some events
 
-       validate_trace_path_ust_pid "$trace_path" "" "gen-ust-eve-ust"
+       validate_trace_path_ust_pid "$trace_path" "" "gen-ust-events"
        validate_trace $event_name $trace_path
 
        rm -rf $trace_path
@@ -124,11 +124,11 @@ function test_tracefile_size_limit ()
 function test_tracefile_size_limit_pagesize ()
 {
        # Set a size limit lower than the page_size
-       size_limit="$(($PAGE_SIZE-2))"
-       trace_path=$(mktemp -d)
-       session_name=$(randstring 16 0)
-       channel_name="channel"
-       event_name="tp:tptest"
+       local size_limit="$(($PAGE_SIZE-2))"
+       local trace_path=$(mktemp --tmpdir -d "tmp.${FUNCNAME[0]}_trace_path.XXXXXX")
+       local session_name=$(randstring 16 0)
+       local channel_name="channel"
+       local event_name="tp:tptest"
 
        diag "Test tracefile size limit lower than PAGE_SIZE : $size_limit bytes"
 
@@ -154,7 +154,7 @@ function test_tracefile_size_limit_pagesize ()
 
        # Validate tracing data, we should at least have some events
 
-       validate_trace_path_ust_pid "$trace_path" "" "gen-ust-eve-ust"
+       validate_trace_path_ust_pid "$trace_path" "" "gen-ust-events"
        validate_trace $event_name $trace_path
 
        rm -rf $trace_path
This page took 0.025301 seconds and 4 git commands to generate.