Cleanup: tests: name all temporary files to better identify leakage
[lttng-tools.git] / tests / regression / tools / tracefile-limits / test_tracefile_size
index 481abc92b80db4a361f0bf30ce54b506ea8d5396..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"
 
@@ -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"
 
This page took 0.023198 seconds and 4 git commands to generate.