+function test_ust_local_snapshot_after_regenerate_metadata ()
+{
+ local file_sync_before_last
+ local metadata_path
+
+ file_sync_before_last=$(mktemp -u)
+
+ diag "Test UST local snapshot after regenerate metadata"
+ create_lttng_session_ok $SESSION_NAME "$TRACE_PATH" --snapshot
+ enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME
+ start_lttng_tracing_ok $SESSION_NAME
+
+ $TESTAPP_BIN -i $NR_ITER -w $NR_USEC_WAIT
+
+ regenerate_metadata_ok $SESSION_NAME
+ lttng_snapshot_record $SESSION_NAME "$TRACE_PATH"
+ stop_lttng_tracing_ok $SESSION_NAME
+
+ validate_trace $EVENT_NAME "$TRACE_PATH"
+ destroy_lttng_session_ok $SESSION_NAME
+
+ rm -rf "$TRACE_PATH"
+}
+