Tests: Add test to check shared-memory FD leaks after relayd dies
[lttng-tools.git] / tests / regression / tools / tracefile-limits / test_tracefile_size
index c07972b77f2cba31b3e4e2601d92496370adc1f1..489e68510f299a7cbe34e91a78ea7461da8b874e 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 -d -t "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 -d -t "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
@@ -164,6 +164,8 @@ plan_tests $NUM_TESTS
 
 print_test_banner "$TEST_DESC"
 
+bail_out_if_no_babeltrace
+
 start_lttng_sessiond
 
 # Test with multiples of PAGE_SIZE
This page took 0.023984 seconds and 4 git commands to generate.