+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"
+
+ diag "Test tracefile size limit lower than PAGE_SIZE : $size_limit bytes"
+
+ create_lttng_session_ok $session_name $trace_path
+
+ enable_lttng_channel_size_limit \
+ $session_name $channel_name $size_limit
+
+ enable_ust_lttng_event_per_channel \
+ $session_name $event_name $channel_name
+
+ start_lttng_tracing_ok $session_name
+
+ $TESTAPP_BIN $NR_ITER >/dev/null 2>&1
+
+ stop_lttng_tracing_ok $session_name
+
+ destroy_lttng_session_ok $session_name
+
+ # Validate file size, expect file size to be equal to the page size
+
+ check_file_size $trace_path "${channel_name}_*" $PAGE_SIZE
+
+ # Validate tracing data, we should at least have some events
+
+ validate_trace $event_name $trace_path
+
+ rm -rf $trace_path
+}
+