+function test_ust_n_snapshot()
+{
+ diag "Test ust snapshot streaming multiple consecutive snapshot"
+ create_lttng_session_no_output "$SESSION_NAME"
+ enable_lttng_mmap_overwrite_ust_channel "$SESSION_NAME" $CHANNEL_NAME
+ enable_ust_lttng_event_ok "$SESSION_NAME" $EVENT_NAME $CHANNEL_NAME
+ snapshot_add_output "$SESSION_NAME" "net://localhost"
+ start_test_app
+ for i in {0..4};
+ do
+ start_lttng_tracing_ok "$SESSION_NAME"
+ lttng_snapshot_record "$SESSION_NAME"
+ stop_lttng_tracing_ok "$SESSION_NAME"
+ validate_trace_path_ust_uid_snapshot_network "$TRACE_PATH" "$SESSION_NAME" "snapshot-1" "$i"
+ if ! validate_trace $EVENT_NAME "$TRACE_PATH/$HOSTNAME/$SESSION_NAME*/snapshot-1*" ; then
+ return 1
+ fi
+ set -u
+ rm -rf "${TRACE_PATH:?}/${HOSTNAME}"
+ set +u
+ done
+
+ destroy_lttng_session_ok "$SESSION_NAME"
+ stop_test_apps
+ return 0
+}
+