+print_test_banner "$TEST_DESC"
+
+bail_out_if_no_babeltrace
+
+if [ "$(id -u)" == "0" ]; then
+ isroot=1
+else
+ isroot=0
+fi
+
+skip $isroot "Root access is needed to set bandwith limits. Skipping all tests." $NUM_TESTS ||
+{
+
+ # Catch sigint and try to cleanup limits
+ trap interrupt_cleanup SIGTERM SIGINT
+
+ BW_LIMITS=(3200 400 100)
+ for BW in "${BW_LIMITS[@]}";
+ do
+ diag "Test high-throughput with bandwidth limit set to ${BW}kbits"
+
+ set_bw_limit "$BW"
+ ok $? "Setting bandwidth limit"
+
+ # shellcheck disable=SC2119
+ start_lttng_sessiond
+ start_lttng_relayd "-o $TRACE_PATH"
+ test_high_throughput
+ result=$?
+ # shellcheck disable=SC2119
+ stop_lttng_relayd
+ # shellcheck disable=SC2119
+ stop_lttng_sessiond
+ reset_bw_limit
+ ok $? "Reset bandwith limits"
+ done
+}