From 9e2d9d2bae015e6748ebf8575ea602ee0fe65c62 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. Change-Id: I29d40fa8bec872bf2e22a8bd933f58fa6376ee22 Signed-off-by: Jonathan Rajotte Signed-off-by: Jérémie Galarneau --- tests/regression/Makefile.am | 67 ++++++++++++------- tests/regression/kernel/test_all_events | 1 + tests/regression/kernel/test_callstack | 1 + 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 | 27 -------- 12 files changed, 69 insertions(+), 50 deletions(-) diff --git a/tests/regression/Makefile.am b/tests/regression/Makefile.am index 73e49c997..bea2b97fb 100644 --- a/tests/regression/Makefile.am +++ b/tests/regression/Makefile.am @@ -7,40 +7,46 @@ LOG_DRIVER = env PGREP='$(PGREP)' AM_TAP_AWK='$(AWK)' $(SHELL) \ $(top_srcdir)/tests/utils/tap-driver.sh TESTS = tools/base-path/test_ust \ + tools/clear/test_kernel \ + tools/clear/test_ust \ + tools/crash/test_crash \ + tools/exclusion/test_exclusion \ tools/filtering/test_invalid_filter \ tools/filtering/test_unsupported_op \ tools/filtering/test_valid_filter \ - tools/streaming/test_ust \ tools/health/test_thread_ok \ + tools/live/test_kernel \ + tools/live/test_lttng_kernel \ + tools/live/test_lttng_ust \ tools/live/test_ust \ tools/live/test_ust_tracefile_count \ - tools/live/test_lttng_ust \ - tools/tracefile-limits/test_tracefile_count \ - tools/tracefile-limits/test_tracefile_size \ - tools/exclusion/test_exclusion \ - tools/snapshots/test_ust_fast \ - tools/snapshots/test_ust_streaming \ - tools/save-load/test_save \ - tools/save-load/test_load \ - tools/save-load/test_autoload \ + tools/metadata/test_kernel \ tools/mi/test_mi \ - tools/wildcard/test_event_wildcard \ - tools/crash/test_crash \ - tools/regen-metadata/test_ust \ - tools/regen-statedump/test_ust \ - tools/notification/test_notification_ust \ tools/notification/test_notification_kernel \ tools/notification/test_notification_multi_app \ - tools/rotation/test_ust \ + tools/notification/test_notification_ust \ + tools/regen-metadata/test_kernel \ + tools/regen-metadata/test_ust \ + tools/regen-statedump/test_kernel \ + tools/regen-statedump/test_ust \ tools/rotation/test_kernel \ tools/rotation/test_save_load_mi \ tools/rotation/test_schedule_api \ - tools/metadata/test_kernel \ - tools/working-directory/test_relayd_working_directory \ - tools/notification/test_notification_multi_app \ - tools/clear/test_ust \ - tools/clear/test_kernel \ - tools/tracker/test_event_tracker + tools/rotation/test_ust \ + tools/save-load/test_autoload \ + tools/save-load/test_load \ + tools/save-load/test_save \ + tools/snapshots/test_kernel \ + tools/snapshots/test_kernel_streaming \ + tools/snapshots/test_ust_fast \ + tools/snapshots/test_ust_streaming \ + tools/streaming/test_kernel \ + tools/streaming/test_ust \ + tools/tracefile-limits/test_tracefile_count \ + tools/tracefile-limits/test_tracefile_size \ + tools/tracker/test_event_tracker \ + tools/wildcard/test_event_wildcard \ + tools/working-directory/test_relayd_working_directory if HAVE_LIBLTTNG_UST_CTL SUBDIRS += ust @@ -63,7 +69,8 @@ TESTS += ust/before-after/test_before_after \ ust/namespaces/test_ns_contexts \ ust/namespaces/test_ns_contexts_change \ tools/metadata/test_ust \ - tools/relayd-grouping/test_ust + tools/relayd-grouping/test_ust \ + ust/test_event_perf endif # HAVE_LIBLTTNG_UST_CTL if PYTHON_BINDING @@ -76,3 +83,17 @@ TESTS += ust/linking/test_linking \ ust/ust-dl/test_ust-dl \ ust/type-declarations/test_type_declarations endif + +TESTS += kernel/test_all_events \ + kernel/test_callstack \ + kernel/test_channel \ + kernel/test_clock_override \ + kernel/test_event_basic \ + 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 + diff --git a/tests/regression/kernel/test_all_events b/tests/regression/kernel/test_all_events index c700de823..e326bfa5e 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 c4a6200da..b92ed12d9 100755 --- a/tests/regression/kernel/test_callstack +++ b/tests/regression/kernel/test_callstack @@ -144,6 +144,7 @@ skip $isroot "Root access is needed. Skipping all tests." "$NUM_TESTS" || test $? -ne 0 skip $? "Babeltrace binary not found. Skipping callstack tests" "$NUM_TESTS" || { + validate_lttng_modules_present start_lttng_sessiond if test $RUN_USERSPACE_TEST == 1; then diff --git a/tests/regression/kernel/test_clock_override b/tests/regression/kernel/test_clock_override index 4b185db89..56f206134 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 f3a393eb8..78f053fcd 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 c0e2f71b4..5ada3db5a 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 1c5d15f02..326eb25c4 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 @@ -174,3 +188,4 @@ test_ns net #test_ns pid # pid_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 722468f57..804b24274 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 2aa4d6fe1..563f47bf4 100755 --- a/tests/regression/kernel/test_select_poll_epoll +++ b/tests/regression/kernel/test_select_poll_epoll @@ -370,6 +370,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 487ee668e..3c529cbc0 100755 --- a/tests/regression/kernel/test_syscall +++ b/tests/regression/kernel/test_syscall @@ -583,6 +583,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 9886f1e15..bbc3dd100 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 59f03440e..3d0868afb 100644 --- a/tests/root_regression +++ b/tests/root_regression @@ -1,28 +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_kernel -regression/tools/notification/test_notification_multi_app -regression/ust/test_event_perf -- 2.34.1