Test: snapshot after regenerate metadata
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Thu, 18 Nov 2021 15:47:16 +0000 (10:47 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 17 Dec 2021 05:31:09 +0000 (00:31 -0500)
Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I48ae0e9d3d4e67172c4a686d42ceadf6bcb81ead

tests/regression/tools/regen-metadata/test_kernel
tests/regression/tools/regen-metadata/test_ust

index 840be8e8515d7d2beb4bb62085ba363c5fb1cf79..49eea32a7dbe73114f0d733efc895d5d293a7616 100755 (executable)
@@ -13,7 +13,7 @@ SESSION_NAME=""
 
 TRACE_PATH=$(mktemp --tmpdir -d tmp.test_regen_metadata_kernel_trace_path.XXXXXX)
 
-NUM_TESTS=24
+NUM_TESTS=32
 
 source $TESTDIR/utils/utils.sh
 
@@ -76,6 +76,25 @@ function test_kernel_local ()
        rm -rf "$TRACE_PATH"
 }
 
+function test_kernel_local_snapshot_after_regenerate_metadata ()
+{
+       diag "Test kernel local snapshot after regenerate metadata"
+       create_lttng_session_ok $SESSION_NAME "$TRACE_PATH" --snapshot
+       lttng_enable_kernel_event $SESSION_NAME $EVENT_NAME
+       start_lttng_tracing_ok $SESSION_NAME
+
+       echo -n "100" > /proc/lttng-test-filter-event
+
+       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"
+}
+
 plan_tests $NUM_TESTS
 
 print_test_banner "$TEST_DESC"
@@ -94,7 +113,8 @@ skip $isroot "Root access is needed. Skipping all kernel streaming tests." $NUM_
        start_lttng_sessiond
        modprobe lttng-test
 
-       tests=( test_kernel_streaming test_kernel_local )
+       tests=( test_kernel_streaming test_kernel_local
+               test_kernel_local_snapshot_after_regenerate_metadata )
 
        for fct_test in ${tests[@]};
        do
index cc3aed9cfcddd38364f6ff89fae1166461ff8e67..9e3596360e0844844d0c1bcb493c35560ee66d02 100755 (executable)
@@ -18,7 +18,7 @@ EVENT_NAME="tp:tptest"
 
 TRACE_PATH=$(mktemp --tmpdir -d tmp.test_regen_metadata_ust_trace_path.XXXXXX)
 
-NUM_TESTS=39
+NUM_TESTS=47
 
 source $TESTDIR/utils/utils.sh
 
@@ -192,6 +192,30 @@ function test_ust_live ()
        rm -f ${file_sync_before_last}
 }
 
+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"
+}
+
 plan_tests $NUM_TESTS
 
 print_test_banner "$TEST_DESC"
@@ -199,7 +223,8 @@ print_test_banner "$TEST_DESC"
 start_lttng_relayd "-o $TRACE_PATH"
 start_lttng_sessiond
 
-tests=( test_ust_streaming test_ust_local test_ust_pid test_ust_live )
+tests=( test_ust_streaming test_ust_local test_ust_pid test_ust_live
+       test_ust_local_snapshot_after_regenerate_metadata)
 
 for fct_test in ${tests[@]};
 do
This page took 0.028243 seconds and 5 git commands to generate.