From ebdd11dff2d1a77b8cebd1601b691711d85495a9 Mon Sep 17 00:00:00 2001 From: Jonathan Rajotte Date: Mon, 31 Jan 2022 14:47:35 -0500 Subject: [PATCH] Tests: add kernel test into the `make check` test suite. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The Jenkins CI mostly run the `make check` suite. Only the Lava base CI run the root_regression test suite. Most of those test can be run on `make check` without incurring any major extra time. Only `regression/tools/streaming/test_high_throughput_limits` is left in root_regression since it is currently "unreasonable" in term of the time it takes to run. This could be tackled another time. Signed-off-by: Jonathan Rajotte Signed-off-by: Jérémie Galarneau Change-Id: I3d59705e84549c2a1840cf96a7723396e2e0c402 --- tests/regression/Makefile.am | 13 ++++++++++ tests/regression/kernel/test_all_events | 1 + tests/regression/kernel/test_callstack | 19 +++++--------- tests/regression/kernel/test_clock_override | 1 + tests/regression/kernel/test_event_basic | 1 + tests/regression/kernel/test_lttng_logger | 1 + .../regression/kernel/test_ns_contexts_change | 15 +++++++++++ .../kernel/test_rotation_destroy_flush | 1 + .../regression/kernel/test_select_poll_epoll | 2 ++ tests/regression/kernel/test_syscall | 1 + tests/regression/kernel/test_userspace_probe | 1 + tests/root_regression | 26 ------------------- 12 files changed, 44 insertions(+), 38 deletions(-) diff --git a/tests/regression/Makefile.am b/tests/regression/Makefile.am index dac6f84e6..74a4c48f1 100644 --- a/tests/regression/Makefile.am +++ b/tests/regression/Makefile.am @@ -81,6 +81,19 @@ TESTS += ust/before-after/test_before_after \ if IS_LINUX TESTS += \ + kernel/test_all_events \ + kernel/test_callstack \ + kernel/test_channel \ + kernel/test_clock_override \ + kernel/test_event_basic \ + kernel/test_kernel_function \ + kernel/test_lttng_logger \ + kernel/test_ns_contexts \ + kernel/test_ns_contexts_change \ + kernel/test_rotation_destroy_flush \ + kernel/test_select_poll_epoll \ + kernel/test_syscall \ + kernel/test_userspace_probe \ ust/namespaces/test_ns_contexts \ ust/namespaces/test_ns_contexts_change endif # IS_LINUX diff --git a/tests/regression/kernel/test_all_events b/tests/regression/kernel/test_all_events index 75b045c9d..2e20888df 100755 --- a/tests/regression/kernel/test_all_events +++ b/tests/regression/kernel/test_all_events @@ -51,6 +51,7 @@ fi skip $isroot "Root access is needed. Skipping all tests." $NUM_TESTS || { + validate_lttng_modules_present start_lttng_sessiond test_all_event diff --git a/tests/regression/kernel/test_callstack b/tests/regression/kernel/test_callstack index b5759d442..a4477fd7c 100755 --- a/tests/regression/kernel/test_callstack +++ b/tests/regression/kernel/test_callstack @@ -142,18 +142,13 @@ fi skip $isroot "Root access is needed. Skipping all tests." "$NUM_TESTS" || { - which "$BABELTRACE_BIN" > /dev/null - test $? -ne 0 - skip $? "Babeltrace binary not found. Skipping callstack tests" "$NUM_TESTS" || - { - start_lttng_sessiond + validate_lttng_modules_present + start_lttng_sessiond - if test $RUN_USERSPACE_TEST == 1; then - test_user_callstack - fi + if test $RUN_USERSPACE_TEST == 1; then + test_user_callstack + fi - test_kernel_callstack - - stop_lttng_sessiond - } + test_kernel_callstack + stop_lttng_sessiond } diff --git a/tests/regression/kernel/test_clock_override b/tests/regression/kernel/test_clock_override index cef30dc30..dfe8894ac 100755 --- a/tests/regression/kernel/test_clock_override +++ b/tests/regression/kernel/test_clock_override @@ -180,6 +180,7 @@ fi skip $isroot "Root access is needed. Skipping all tests." $NUM_TESTS || { + validate_lttng_modules_present trap signal_cleanup SIGTERM SIGINT while [ "$i" -lt "$TEST_COUNT" ]; do diff --git a/tests/regression/kernel/test_event_basic b/tests/regression/kernel/test_event_basic index c2500c69d..ac9ec0549 100755 --- a/tests/regression/kernel/test_event_basic +++ b/tests/regression/kernel/test_event_basic @@ -81,6 +81,7 @@ fi skip $isroot "Root access is needed. Skipping all tests." $NUM_TESTS || { + validate_lttng_modules_present start_lttng_sessiond test_event_basic diff --git a/tests/regression/kernel/test_lttng_logger b/tests/regression/kernel/test_lttng_logger index 9fa8ca33f..b8f7ded82 100755 --- a/tests/regression/kernel/test_lttng_logger +++ b/tests/regression/kernel/test_lttng_logger @@ -118,6 +118,7 @@ fi skip $isroot "Root access is needed. Skipping all tests." $NUM_TESTS || { + validate_lttng_modules_present start_lttng_sessiond test_proc_logger diff --git a/tests/regression/kernel/test_ns_contexts_change b/tests/regression/kernel/test_ns_contexts_change index e32a75b8a..42a61276b 100755 --- a/tests/regression/kernel/test_ns_contexts_change +++ b/tests/regression/kernel/test_ns_contexts_change @@ -131,8 +131,22 @@ function test_ns() # Check that the events contain the right namespace inode number validate_trace_count "${ns}_ns = $app_ns_inode" "$trace_path" 1 validate_trace_count "${ns}_ns = $app_unshare_ns_inode" "$trace_path" 1 + else + touch "$file_sync_wait_before_unshare" + + while [ ! -f "$file_sync_signal_after_unshare" ]; do + # Break if the app failed / died + if ! kill -0 "$app_pid" ; then + break + echo "# App failed" + fi + echo "# Waiting for app..." + sleep 0.5 + done + touch "$file_sync_wait_after_unshare" fi + # stop and destroy destroy_lttng_session_ok "$session_name" stop_lttng_sessiond @@ -175,3 +189,4 @@ test_ns net #test_ns time # time_ns is special, can't be changed that way test_ns user test_ns uts +set +x diff --git a/tests/regression/kernel/test_rotation_destroy_flush b/tests/regression/kernel/test_rotation_destroy_flush index 57434b0a5..cb773d7df 100755 --- a/tests/regression/kernel/test_rotation_destroy_flush +++ b/tests/regression/kernel/test_rotation_destroy_flush @@ -128,6 +128,7 @@ fi skip $isroot "Root access is needed. Skipping all tests." $NUM_TESTS || { + validate_lttng_modules_present trap signal_cleanup SIGTERM SIGINT while [ "$i" -lt "$TEST_COUNT" ]; do diff --git a/tests/regression/kernel/test_select_poll_epoll b/tests/regression/kernel/test_select_poll_epoll index 6d5509b25..17e7dd4db 100755 --- a/tests/regression/kernel/test_select_poll_epoll +++ b/tests/regression/kernel/test_select_poll_epoll @@ -381,6 +381,8 @@ fi skip $isroot "Root access is needed. Skipping all tests." $NUM_TESTS || { + validate_lttng_modules_present + start_lttng_sessiond test_working_cases diff --git a/tests/regression/kernel/test_syscall b/tests/regression/kernel/test_syscall index b193dfb88..401a18a8d 100755 --- a/tests/regression/kernel/test_syscall +++ b/tests/regression/kernel/test_syscall @@ -672,6 +672,7 @@ fi skip $isroot "Root access is needed. Skipping all tests." $NUM_TESTS || { + validate_lttng_modules_present start_lttng_sessiond test_syscall_event_list diff --git a/tests/regression/kernel/test_userspace_probe b/tests/regression/kernel/test_userspace_probe index 0efcb9165..31b11e98d 100755 --- a/tests/regression/kernel/test_userspace_probe +++ b/tests/regression/kernel/test_userspace_probe @@ -822,6 +822,7 @@ fi skip $isroot "Root access is needed. Skipping all tests." $NUM_TESTS || { + validate_lttng_modules_present start_lttng_sessiond # Unsuccessful event enabling diff --git a/tests/root_regression b/tests/root_regression index 894e8dcbf..3d0868afb 100644 --- a/tests/root_regression +++ b/tests/root_regression @@ -1,27 +1 @@ -regression/kernel/test_all_events -regression/kernel/test_channel -regression/kernel/test_event_basic -regression/kernel/test_syscall -regression/kernel/test_clock_override -regression/kernel/test_rotation_destroy_flush -regression/kernel/test_select_poll_epoll -regression/kernel/test_lttng_logger -regression/kernel/test_callstack -regression/kernel/test_userspace_probe -regression/kernel/test_ns_contexts -regression/kernel/test_ns_contexts_change -regression/tools/live/test_kernel -regression/tools/live/test_lttng_kernel regression/tools/streaming/test_high_throughput_limits -regression/tools/streaming/test_kernel -regression/tools/snapshots/test_kernel -regression/tools/snapshots/test_kernel_streaming -regression/tools/health/test_thread_ok -regression/tools/filtering/test_invalid_filter -regression/tools/filtering/test_unsupported_op -regression/tools/filtering/test_valid_filter -regression/tools/wildcard/test_event_wildcard -regression/tools/regen-metadata/test_kernel -regression/tools/regen-statedump/test_kernel -regression/tools/notification/test_notification_multi_app -regression/ust/test_event_perf -- 2.34.1