]> git.lttng.org Git - lttng-tools.git/commitdiff
tests: Test that no LTTng modules are loaded before and after kernel tests master
authorKienan Stewart <kstewart@efficios.com>
Thu, 4 Jul 2024 13:28:32 +0000 (09:28 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 29 Nov 2024 22:32:44 +0000 (17:32 -0500)
Observed issue
==============

If a test or a component in LTTng fails to unload the modules
properly, the state of the system is polluted.

Solution
========

Use a helper test function and check before and after each of the
kernel tests.

Known drawbacks
===============

None.

Change-Id: I0cce0d9e280bd66535af490c9a111526ab78373c
Signed-off-by: Kienan Stewart <kstewart@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
23 files changed:
tests/regression/kernel/test_all_events
tests/regression/kernel/test_callstack
tests/regression/kernel/test_channel
tests/regression/kernel/test_clock_override
tests/regression/kernel/test_event_basic
tests/regression/kernel/test_kernel_function
tests/regression/kernel/test_lttng_logger
tests/regression/kernel/test_ns_contexts
tests/regression/kernel/test_ns_contexts_change
tests/regression/kernel/test_rotation_destroy_flush
tests/regression/kernel/test_select_poll_epoll
tests/regression/kernel/test_syscall
tests/regression/kernel/test_userspace_probe
tests/regression/tools/clear/test_kernel
tests/regression/tools/crash/test_crash
tests/regression/tools/filtering/test_valid_filter
tests/regression/tools/live/test_kernel
tests/regression/tools/metadata/test_kernel
tests/regression/tools/regen-metadata/test_kernel
tests/regression/tools/regen-statedump/test_kernel
tests/regression/tools/rotation/test_kernel
tests/regression/tools/snapshots/test_kernel
tests/regression/tools/streaming/test_kernel

index dd6dab5e519c98ad64b82472e23b5e8e05497926..1683f23ac72f2e10f1e2ef6832b1dbb8d4f5d4c2 100755 (executable)
@@ -9,7 +9,7 @@ TEST_DESC="Kernel tracer - All events"
 
 CURDIR=$(dirname $0)/
 TESTDIR=$CURDIR/../..
 
 CURDIR=$(dirname $0)/
 TESTDIR=$CURDIR/../..
-NUM_TESTS=8
+NUM_TESTS=10
 
 TESTCMD="/bin/true"
 
 
 TESTCMD="/bin/true"
 
@@ -45,10 +45,12 @@ print_test_banner "$TEST_DESC"
 
 check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." ||
 {
 
 check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." ||
 {
+       lttng_modules_loaded_fail
        validate_lttng_modules_present
        start_lttng_sessiond
 
        test_all_event
 
        stop_lttng_sessiond
        validate_lttng_modules_present
        start_lttng_sessiond
 
        test_all_event
 
        stop_lttng_sessiond
+       lttng_modules_loaded_fail
 }
 }
index 6131c251b86a52562ff812bc283e07dcd7ed5c17..b39d8a453eb4ae25ef9bfb3366a9ca88978e6985 100755 (executable)
@@ -9,7 +9,7 @@ TEST_DESC="Kernel tracer - Callstack context"
 
 CURDIR=$(dirname "$0")/
 TESTDIR=$CURDIR/../..
 
 CURDIR=$(dirname "$0")/
 TESTDIR=$CURDIR/../..
-NUM_TESTS=12
+NUM_TESTS=14
 TEST_APP_USERSPACE="$TESTDIR/utils/testapp/gen-syscall-events-callstack/gen-syscall-events-callstack"
 TEST_APP_KERNELSPACE="$TESTDIR/utils/testapp/gen-syscall-events/gen-syscall-events"
 PARSE_CALLSTACK="$TESTDIR/utils/parse-callstack.py"
 TEST_APP_USERSPACE="$TESTDIR/utils/testapp/gen-syscall-events-callstack/gen-syscall-events-callstack"
 TEST_APP_KERNELSPACE="$TESTDIR/utils/testapp/gen-syscall-events/gen-syscall-events"
 PARSE_CALLSTACK="$TESTDIR/utils/parse-callstack.py"
@@ -138,6 +138,7 @@ bail_out_if_no_babeltrace
 
 check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." ||
 {
 
 check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." ||
 {
+       lttng_modules_loaded_fail
        validate_lttng_modules_present
        start_lttng_sessiond
 
        validate_lttng_modules_present
        start_lttng_sessiond
 
@@ -148,4 +149,5 @@ check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." ||
        test_kernel_callstack
 
        stop_lttng_sessiond
        test_kernel_callstack
 
        stop_lttng_sessiond
+       lttng_modules_loaded_fail
 }
 }
index 6c7d2db0791bdbb810bb1ccd9b71bf5a1e11341b..f281000cf853c24049b42156b84a7f58c4640741 100755 (executable)
@@ -9,7 +9,7 @@ TEST_DESC="Kernel tracer - Channel configuration"
 
 CURDIR=$(dirname $0)/
 TESTDIR=$CURDIR/../..
 
 CURDIR=$(dirname $0)/
 TESTDIR=$CURDIR/../..
-NUM_TESTS=8
+NUM_TESTS=10
 
 source $TESTDIR/utils/utils.sh
 
 
 source $TESTDIR/utils/utils.sh
 
@@ -49,10 +49,12 @@ print_test_banner "$TEST_DESC"
 
 check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." ||
 {
 
 check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." ||
 {
+       lttng_modules_loaded_fail
        start_lttng_sessiond
 
        test_channel_buffer
        test_channel_buffer_too_large
 
        stop_lttng_sessiond
        start_lttng_sessiond
 
        test_channel_buffer
        test_channel_buffer_too_large
 
        stop_lttng_sessiond
+       lttng_modules_loaded_fail
 }
 }
index f9ece05b8d1fab2f26825799b7eec2b7ca787d02..06377b80af9f78c24f3f8a4b8865da99c4e17655 100755 (executable)
@@ -12,7 +12,7 @@ CURDIR=$(dirname $0)/
 TESTDIR=$CURDIR/../..
 SESSION_NAME="clock_override"
 
 TESTDIR=$CURDIR/../..
 SESSION_NAME="clock_override"
 
-NUM_TESTS=30
+NUM_TESTS=32
 EVENT_NAME="lttng_test_filter_event"
 
 TESTCMD="echo -n 10 > /proc/lttng-test-filter-event"
 EVENT_NAME="lttng_test_filter_event"
 
 TESTCMD="echo -n 10 > /proc/lttng-test-filter-event"
@@ -148,8 +148,9 @@ function test_clock_override_timestamp()
        stop_lttng_tracing_ok $SESSION_NAME
        destroy_lttng_session_ok $SESSION_NAME
 
        stop_lttng_tracing_ok $SESSION_NAME
        destroy_lttng_session_ok $SESSION_NAME
 
+       modprobe --remove lttng-test
        stop_lttng_sessiond
        stop_lttng_sessiond
-       modprobe --remove lttng-test lttng-clock-plugin-test lttng-clock
+       modprobe --remove lttng-clock-plugin-test lttng-clock
 
        # Use Babeltrace with "-n all" to give a comma separated list for
        # easy extraction of timestamps.
 
        # Use Babeltrace with "-n all" to give a comma separated list for
        # easy extraction of timestamps.
@@ -176,6 +177,7 @@ i=0
 
 check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." ||
 {
 
 check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." ||
 {
+       lttng_modules_loaded_fail
        validate_lttng_modules_present
        trap signal_cleanup SIGTERM SIGINT
 
        validate_lttng_modules_present
        trap signal_cleanup SIGTERM SIGINT
 
@@ -190,4 +192,5 @@ check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." ||
 
                let "i++"
        done
 
                let "i++"
        done
+       lttng_modules_loaded_fail
 }
 }
index e57cd6d26a1561805da32bc28ba1cb8192bd0433..b32288b5f5ffef03780fa3a02d535690c66f16c5 100755 (executable)
@@ -9,7 +9,7 @@ TEST_DESC="Kernel tracer - Basic event"
 
 CURDIR=$(dirname $0)/
 TESTDIR=$CURDIR/../..
 
 CURDIR=$(dirname $0)/
 TESTDIR=$CURDIR/../..
-NUM_TESTS=21
+NUM_TESTS=23
 
 TESTCMD="/bin/true"
 
 
 TESTCMD="/bin/true"
 
@@ -75,6 +75,7 @@ print_test_banner "$TEST_DESC"
 
 check_skip_kernel_test $NUM_TESTS "Skipping all tests." ||
 {
 
 check_skip_kernel_test $NUM_TESTS "Skipping all tests." ||
 {
+       lttng_modules_loaded_fail
        validate_lttng_modules_present
        start_lttng_sessiond
 
        validate_lttng_modules_present
        start_lttng_sessiond
 
@@ -82,4 +83,5 @@ check_skip_kernel_test $NUM_TESTS "Skipping all tests." ||
        test_enable_after_start
 
        stop_lttng_sessiond
        test_enable_after_start
 
        stop_lttng_sessiond
+       lttng_modules_loaded_fail
 }
 }
index 3c941c72c78424b947e215117b360b62fff71c0f..6d2145b97a7a187cc61649ded2e4a0075459d097 100755 (executable)
@@ -9,7 +9,7 @@ TEST_DESC="Kernel tracer - function event"
 
 CURDIR=$(dirname $0)/
 TESTDIR=$CURDIR/../..
 
 CURDIR=$(dirname $0)/
 TESTDIR=$CURDIR/../..
-NUM_TESTS=7
+NUM_TESTS=9
 
 source $TESTDIR/utils/utils.sh
 
 
 source $TESTDIR/utils/utils.sh
 
@@ -45,6 +45,7 @@ print_test_banner "$TEST_DESC"
 
 check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." ||
 {
 
 check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." ||
 {
+       lttng_modules_loaded_fail
        start_lttng_sessiond_notap
        validate_lttng_modules_present
        modprobe lttng-test
        start_lttng_sessiond_notap
        validate_lttng_modules_present
        modprobe lttng-test
@@ -53,4 +54,5 @@ check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." ||
 
        modprobe --remove lttng-test
        stop_lttng_sessiond_notap
 
        modprobe --remove lttng-test
        stop_lttng_sessiond_notap
+       lttng_modules_loaded_fail
 }
 }
index c6ed4f950589a0bdfe0e505f3c614ee4b2cb9932..49b852fa32a75e8201ef5a1dcb099b6091eae593 100755 (executable)
@@ -9,7 +9,7 @@ TEST_DESC="Kernel tracer - lttng-logger"
 
 CURDIR=$(dirname $0)/
 TESTDIR=$CURDIR/../..
 
 CURDIR=$(dirname $0)/
 TESTDIR=$CURDIR/../..
-NUM_TESTS=30
+NUM_TESTS=32
 PAYLOAD="test_logger"
 SESSION_NAME="kernel_event_basic"
 
 PAYLOAD="test_logger"
 SESSION_NAME="kernel_event_basic"
 
@@ -112,6 +112,7 @@ print_test_banner "$TEST_DESC"
 
 check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." ||
 {
 
 check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." ||
 {
+       lttng_modules_loaded_fail
        validate_lttng_modules_present
        start_lttng_sessiond
 
        validate_lttng_modules_present
        start_lttng_sessiond
 
@@ -120,4 +121,5 @@ check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." ||
        test_payload_limit
 
        stop_lttng_sessiond
        test_payload_limit
 
        stop_lttng_sessiond
+       lttng_modules_loaded_fail
 }
 }
index 8fec8be1b3efa455f30be192e1620a714b42c469..e16b22c961109547fe82096ee11518c9fed58936 100755 (executable)
@@ -9,7 +9,7 @@ TEST_DESC="Kernel tracer - Namespace contexts"
 CURDIR=$(dirname "$0")/
 TESTDIR=$CURDIR/../..
 
 CURDIR=$(dirname "$0")/
 TESTDIR=$CURDIR/../..
 
-TESTS_PER_NS=11
+TESTS_PER_NS=13
 
 NUM_TESTS=$((TESTS_PER_NS * 8))
 
 
 NUM_TESTS=$((TESTS_PER_NS * 8))
 
@@ -75,6 +75,7 @@ function test_ns()
 
        trace_path=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX")
 
 
        trace_path=$(mktemp -d -t "tmp.${FUNCNAME[0]}_trace_path.XXXXXX")
 
+       lttng_modules_loaded_fail
        start_lttng_sessiond
 
        create_lttng_session_ok "$session_name" "$trace_path"
        start_lttng_sessiond
 
        create_lttng_session_ok "$session_name" "$trace_path"
@@ -95,6 +96,7 @@ function test_ns()
 
        destroy_lttng_session_ok "$session_name"
        stop_lttng_sessiond
 
        destroy_lttng_session_ok "$session_name"
        stop_lttng_sessiond
+       lttng_modules_loaded_fail
 
        rm -rf "$trace_path"
 }
 
        rm -rf "$trace_path"
 }
index 21612805d3cdf433b57c73fc779df34ddd2af3a5..d52c4884d94deaa74e50fd1d789918173868ef8f 100755 (executable)
@@ -13,7 +13,7 @@ TESTAPP_PATH="$TESTDIR/utils/testapp"
 TESTAPP_NAME="gen-ns-events"
 TESTAPP_BIN="$TESTAPP_PATH/$TESTAPP_NAME/$TESTAPP_NAME"
 
 TESTAPP_NAME="gen-ns-events"
 TESTAPP_BIN="$TESTAPP_PATH/$TESTAPP_NAME/$TESTAPP_NAME"
 
-TESTS_PER_NS=19
+TESTS_PER_NS=21
 
 NUM_TESTS=$((TESTS_PER_NS * 6))
 
 
 NUM_TESTS=$((TESTS_PER_NS * 6))
 
@@ -93,6 +93,7 @@ function test_ns()
        app_ns_inode=$(stat -c '%i' -L "/proc/$app_pid/ns/$ns")
        ok $? "Get app current $ns namespace inode: $app_ns_inode" || app_ns_inode="invalid"
 
        app_ns_inode=$(stat -c '%i' -L "/proc/$app_pid/ns/$ns")
        ok $? "Get app current $ns namespace inode: $app_ns_inode" || app_ns_inode="invalid"
 
+       lttng_modules_loaded_fail
        start_lttng_sessiond
 
        create_lttng_session_ok "$session_name" "$trace_path"
        start_lttng_sessiond
 
        create_lttng_session_ok "$session_name" "$trace_path"
@@ -147,6 +148,7 @@ function test_ns()
        # stop and destroy
        destroy_lttng_session_ok "$session_name"
        stop_lttng_sessiond
        # stop and destroy
        destroy_lttng_session_ok "$session_name"
        stop_lttng_sessiond
+       lttng_modules_loaded_fail
 
        rm -rf "$trace_path"
        rm -f "$file_sync_wait_after_unshare"
 
        rm -rf "$trace_path"
        rm -f "$file_sync_wait_after_unshare"
index 70f73fda3d03e827343bfc9a5f23fb9aab2d4b73..55b36f2191cba2287af44ccc7315e633c890914d 100755 (executable)
@@ -13,7 +13,7 @@ TESTDIR=$CURDIR/../..
 SESSION_NAME="rotation_destroy_flush"
 
 NR_ITER=10
 SESSION_NAME="rotation_destroy_flush"
 
 NR_ITER=10
-NUM_TESTS=$((13*$NR_ITER))
+NUM_TESTS=$((15*$NR_ITER))
 EVENT_NAME="lttng_test_filter_event"
 CHANNEL_NAME="testchan"
 PAGE_SIZE=$(getconf PAGE_SIZE)
 EVENT_NAME="lttng_test_filter_event"
 CHANNEL_NAME="testchan"
 PAGE_SIZE=$(getconf PAGE_SIZE)
@@ -70,6 +70,7 @@ function enable_kernel_lttng_event_per_channel ()
 
 function test_rotation_destroy_flush_single()
 {
 
 function test_rotation_destroy_flush_single()
 {
+       lttng_modules_loaded_fail
        start_lttng_sessiond
        modprobe lttng-test
 
        start_lttng_sessiond
        modprobe lttng-test
 
@@ -100,6 +101,7 @@ function test_rotation_destroy_flush_single()
 
        modprobe --remove lttng-test
        stop_lttng_sessiond
 
        modprobe --remove lttng-test
        stop_lttng_sessiond
+       lttng_modules_loaded_fail
 }
 
 function test_rotation_destroy_flush()
 }
 
 function test_rotation_destroy_flush()
index a359945cd59881fa564c776bbf51d5e76bca64c0..bb039617657ac0de71d9c1207f2972b9c4e5c1bb 100755 (executable)
@@ -30,7 +30,7 @@ SUPPORTED_SYSCALLS_LIST=$("$CURDIR"/select_poll_epoll --list-supported-test-sysc
 SUPPORTED_SYSCALLS_COUNT=$(echo $SUPPORTED_SYSCALLS_LIST | awk -F '[\t,]' '{print NF}')
 
 # Two tests validate their trace for every supported syscall
 SUPPORTED_SYSCALLS_COUNT=$(echo $SUPPORTED_SYSCALLS_LIST | awk -F '[\t,]' '{print NF}')
 
 # Two tests validate their trace for every supported syscall
-NUM_TESTS=$((88+(2*SUPPORTED_SYSCALLS_COUNT)))
+NUM_TESTS=$((90+(2*SUPPORTED_SYSCALLS_COUNT)))
 
 # shellcheck source=../../utils/utils.sh
 source $TESTDIR/utils/utils.sh
 
 # shellcheck source=../../utils/utils.sh
 source $TESTDIR/utils/utils.sh
@@ -367,6 +367,7 @@ diag "Supported syscalls are $SUPPORTED_SYSCALLS_LIST"
 
 check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." ||
 {
 
 check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." ||
 {
+       lttng_modules_loaded_fail
        validate_lttng_modules_present
 
        start_lttng_sessiond
        validate_lttng_modules_present
 
        start_lttng_sessiond
@@ -384,6 +385,7 @@ check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." ||
        test_epoll_pwait_concurrent_unmap
 
        stop_lttng_sessiond
        test_epoll_pwait_concurrent_unmap
 
        stop_lttng_sessiond
+       lttng_modules_loaded_fail
 
        NEW_WARNING=$(dmesg | grep " WARNING:" | cut -d' ' -f1 | tail -1)
        NEW_OOPS=$(dmesg | grep " OOPS:" | cut -d' ' -f1 | tail -1)
 
        NEW_WARNING=$(dmesg | grep " WARNING:" | cut -d' ' -f1 | tail -1)
        NEW_OOPS=$(dmesg | grep " OOPS:" | cut -d' ' -f1 | tail -1)
index 92d79a7bcba884e28995ac75dfd6740a5f79dd7d..5b6c8a2f94ff12f0c4e335b1ef2d79dcdaaa8748 100755 (executable)
@@ -10,7 +10,7 @@ TEST_DESC="Kernel tracer - System calls"
 
 CURDIR=$(dirname $0)/
 TESTDIR=$CURDIR/../..
 
 CURDIR=$(dirname $0)/
 TESTDIR=$CURDIR/../..
-NUM_TESTS=214
+NUM_TESTS=216
 
 # `gen-syscall-event` starts and waits for the creation a file passed by
 # arguments to start executing 3 syscalls (open,read,close) and returning.
 
 # `gen-syscall-event` starts and waits for the creation a file passed by
 # arguments to start executing 3 syscalls (open,read,close) and returning.
@@ -666,6 +666,7 @@ print_test_banner "$TEST_DESC"
 
 check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." ||
 {
 
 check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." ||
 {
+       lttng_modules_loaded_fail
        validate_lttng_modules_present
        start_lttng_sessiond
 
        validate_lttng_modules_present
        start_lttng_sessiond
 
@@ -695,4 +696,5 @@ check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." ||
        test_syscall_enable_channel_disable_one
 
        stop_lttng_sessiond
        test_syscall_enable_channel_disable_one
 
        stop_lttng_sessiond
+       lttng_modules_loaded_fail
 }
 }
index 38987f7b18aefafacc1953880c736e5fc180ca8f..598539f422abb71136682e9d0c55c0164f4b26f3 100755 (executable)
@@ -22,7 +22,7 @@ SDT_TEST_BIN_NAME="userspace-probe-sdt-binary"
 SDT_TEST_BIN="$SDT_TEST_BIN_DIR/$SDT_TEST_BIN_NAME"
 ELF_SYMBOL="test_function"
 PROBE_EVENT_NAME=userspace_probe_test_event
 SDT_TEST_BIN="$SDT_TEST_BIN_DIR/$SDT_TEST_BIN_NAME"
 ELF_SYMBOL="test_function"
 PROBE_EVENT_NAME=userspace_probe_test_event
-NUM_TESTS=93
+NUM_TESTS=95
 OUTPUT_DEST=/dev/null
 ERROR_OUTPUT_DEST=/dev/null
 
 OUTPUT_DEST=/dev/null
 ERROR_OUTPUT_DEST=/dev/null
 
@@ -817,6 +817,7 @@ print_test_banner "$TEST_DESC"
 
 check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." ||
 {
 
 check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." ||
 {
+       lttng_modules_loaded_fail
        validate_lttng_modules_present
        start_lttng_sessiond
 
        validate_lttng_modules_present
        start_lttng_sessiond
 
@@ -880,4 +881,5 @@ check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." ||
        fi
 
        stop_lttng_sessiond
        fi
 
        stop_lttng_sessiond
+       lttng_modules_loaded_fail
 }
 }
index 2819c24bcdb4cdda2105046408e47158dd5008ed..d0af47928fb3e0acebe71127f59d1650da141d5a 100755 (executable)
@@ -13,7 +13,7 @@ EVENT_NAME="lttng_test_filter_event"
 PAGE_SIZE=$(getconf PAGE_SIZE)
 TRACE_PATH=$(mktemp -d -t tmp.test_clear_kernel_trace_path.XXXXXX)
 
 PAGE_SIZE=$(getconf PAGE_SIZE)
 TRACE_PATH=$(mktemp -d -t tmp.test_clear_kernel_trace_path.XXXXXX)
 
-NUM_TESTS=837
+NUM_TESTS=839
 
 # shellcheck source=../utils/utils.sh
 source "$TESTDIR/utils/utils.sh"
 
 # shellcheck source=../utils/utils.sh
 source "$TESTDIR/utils/utils.sh"
@@ -563,6 +563,7 @@ check_skip_kernel_test "$NUM_TESTS" "Skipping kernel streaming tests." ||
 {
        trap signal_cleanup SIGTERM SIGINT
 
 {
        trap signal_cleanup SIGTERM SIGINT
 
+       lttng_modules_loaded_fail
        validate_lttng_modules_present
 
        start_lttng_relayd "-o $TRACE_PATH"
        validate_lttng_modules_present
 
        start_lttng_relayd "-o $TRACE_PATH"
@@ -620,6 +621,7 @@ check_skip_kernel_test "$NUM_TESTS" "Skipping kernel streaming tests." ||
        modprobe --remove lttng-test
        stop_lttng_sessiond
        stop_lttng_relayd
        modprobe --remove lttng-test
        stop_lttng_sessiond
        stop_lttng_relayd
+       lttng_modules_loaded_fail
 
        test_kernel_disallow_clear
 }
 
        test_kernel_disallow_clear
 }
index 3fa9dbe959bf0381354e93df06f679ffd9170155..3f53343b6f77c94fc745d067820aa86cde41720a 100755 (executable)
@@ -23,7 +23,7 @@ OUTPUT_DIR=$(mktemp -d -t tmp.test_crash_shm.XXXXXX)
 
 LAST_APP_PID=
 
 
 LAST_APP_PID=
 
-NUM_TESTS=76
+NUM_TESTS=77
 
 source $TESTDIR/utils/utils.sh
 
 
 source $TESTDIR/utils/utils.sh
 
@@ -405,6 +405,7 @@ TESTS=(
 
 trap interrupt_cleanup SIGTERM SIGINT
 
 
 trap interrupt_cleanup SIGTERM SIGINT
 
+
 for fct_test in ${TESTS[@]};
 do
        ${fct_test}
 for fct_test in ${TESTS[@]};
 do
        ${fct_test}
@@ -412,6 +413,12 @@ do
                break;
        fi
 done
                break;
        fi
 done
+
+# Start and stop to clean up kernel modules
+start_lttng_sessiond_notap
+stop_lttng_sessiond_notap
+lttng_modules_loaded_fail
+
 rm -rf $OUTPUT_DIR
 
 OUTPUT_DEST=/dev/null 2>&1
 rm -rf $OUTPUT_DIR
 
 OUTPUT_DEST=/dev/null 2>&1
index 79a9d85f237c393317e9df6da9ae369aeb3a29d0..8ff98098a85773c0d342e74332f52ddea6139b83 100755 (executable)
@@ -13,7 +13,7 @@ BT2_PLUGINS_DIR="${TESTDIR}/utils/bt2_plugins"
 
 SESSION_NAME="valid_filter"
 NR_ITER=100
 
 SESSION_NAME="valid_filter"
 NR_ITER=100
-NUM_GLOBAL_TESTS=2
+NUM_GLOBAL_TESTS=4
 NUM_UST_TESTS=1122
 NUM_KERNEL_TESTS=1056
 NUM_TESTS=$(($NUM_UST_TESTS+$NUM_KERNEL_TESTS+$NUM_GLOBAL_TESTS))
 NUM_UST_TESTS=1122
 NUM_KERNEL_TESTS=1056
 NUM_TESTS=$(($NUM_UST_TESTS+$NUM_KERNEL_TESTS+$NUM_GLOBAL_TESTS))
@@ -406,6 +406,7 @@ issue_356_filter+="intfield > 4 && intfield > 5 && "
 issue_356_filter+="intfield > 6 && intfield > 7 && "
 issue_356_filter+="intfield > 8 || intfield > 0"
 
 issue_356_filter+="intfield > 6 && intfield > 7 && "
 issue_356_filter+="intfield > 8 || intfield > 0"
 
+lttng_modules_loaded_fail
 start_lttng_sessiond
 
 ### UST TESTS
 start_lttng_sessiond
 
 ### UST TESTS
@@ -1470,6 +1471,11 @@ check_skip_kernel_test "$NUM_KERNEL_TESTS" "Skipping kernel valid filter tests."
                test_valid_filter kernel -k "lttng_test_filter_event" "$filter" "validator_$validator"
 
                if [ $? -eq 1 ]; then
                test_valid_filter kernel -k "lttng_test_filter_event" "$filter" "validator_$validator"
 
                if [ $? -eq 1 ]; then
+                       # The module removal will fail if events are
+                       # still being produced
+                       while ! modprobe --remove lttng-test ; do
+                               sleep 1
+                       done
                        stop_lttng_sessiond
                        exit 1
                fi
                        stop_lttng_sessiond
                        exit 1
                fi
@@ -1477,7 +1483,11 @@ check_skip_kernel_test "$NUM_KERNEL_TESTS" "Skipping kernel valid filter tests."
                i=$(( i + 2 ))
        done
 
                i=$(( i + 2 ))
        done
 
-       modprobe --remove lttng-test
+       # The module removal will fail if events are still being produced
+       while ! modprobe --remove lttng-test ; do
+               sleep 1
+       done
 }
 
 stop_lttng_sessiond
 }
 
 stop_lttng_sessiond
+lttng_modules_loaded_fail
index df30fcf56242e940ec974af197414de788bf95fe..2c181c9ed1752fd7ecbef65ed4d29c8f0937d189 100755 (executable)
@@ -60,6 +60,5 @@ $TESTDIR/regression/tools/live/live_test
 clean_live_tracing
 
 stop_lttng_relayd_notap
 clean_live_tracing
 
 stop_lttng_relayd_notap
-stop_lttng_sessiond_notap
-
 modprobe --remove lttng-test
 modprobe --remove lttng-test
+stop_lttng_sessiond_notap
index 1b0225ec53c9df81ca7a856d6122f970117142a0..ea84aead13f03ab4ff560b760ac3da0de359432b 100755 (executable)
@@ -12,7 +12,7 @@ EVENT_NAME="lttng_test_filter_event"
 
 TRACE_PATH=$(mktemp -d -t tmp.test_metadata_env_kernel_trace_path.XXXXXX)
 
 
 TRACE_PATH=$(mktemp -d -t tmp.test_metadata_env_kernel_trace_path.XXXXXX)
 
-NUM_TESTS=13
+NUM_TESTS=15
 
 source "$TESTDIR/utils/utils.sh"
 
 
 source "$TESTDIR/utils/utils.sh"
 
@@ -100,6 +100,7 @@ bail_out_if_no_babeltrace
 
 check_skip_kernel_test "$NUM_TESTS" "Skipping kernel metadata tests." ||
 {
 
 check_skip_kernel_test "$NUM_TESTS" "Skipping kernel metadata tests." ||
 {
+       lttng_modules_loaded_fail
        validate_lttng_modules_present
        modprobe lttng-test
 
        validate_lttng_modules_present
        modprobe lttng-test
 
@@ -119,6 +120,7 @@ check_skip_kernel_test "$NUM_TESTS" "Skipping kernel metadata tests." ||
        modprobe --remove lttng-test
 
        stop_lttng_sessiond
        modprobe --remove lttng-test
 
        stop_lttng_sessiond
+       lttng_modules_loaded_fail
        unset LTTNG_HOME
 }
 
        unset LTTNG_HOME
 }
 
index 1b5ce2a0b2239545fd58b2a367baef9141cf4a43..b95fc1c9d2a17789a0039b0f92b21d6a75e6d1ad 100755 (executable)
@@ -13,7 +13,7 @@ SESSION_NAME=""
 
 TRACE_PATH=$(mktemp -d -t tmp.test_regen_metadata_kernel_trace_path.XXXXXX)
 
 
 TRACE_PATH=$(mktemp -d -t tmp.test_regen_metadata_kernel_trace_path.XXXXXX)
 
-NUM_TESTS=32
+NUM_TESTS=34
 
 source $TESTDIR/utils/utils.sh
 
 
 source $TESTDIR/utils/utils.sh
 
@@ -101,6 +101,7 @@ print_test_banner "$TEST_DESC"
 
 check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." ||
 {
 
 check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." ||
 {
+       lttng_modules_loaded_fail
        validate_lttng_modules_present
 
        start_lttng_relayd "-o $TRACE_PATH"
        validate_lttng_modules_present
 
        start_lttng_relayd "-o $TRACE_PATH"
@@ -119,4 +120,5 @@ check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." ||
        modprobe --remove lttng-test
        stop_lttng_sessiond
        stop_lttng_relayd
        modprobe --remove lttng-test
        stop_lttng_sessiond
        stop_lttng_relayd
+       lttng_modules_loaded_fail
 }
 }
index 758b95d071efceea6974fa291aacd2fba6c95408..b4e9c19f52674006e87ac86b411da5d8ab6cc946 100755 (executable)
@@ -14,7 +14,7 @@ EVENT_NAME="lttng_statedump_start,lttng_statedump_end"
 
 TRACE_PATH=$(mktemp -d -t tmp.test_regenerate_statedump_kernel_trace_path.XXXXXX)
 
 
 TRACE_PATH=$(mktemp -d -t tmp.test_regenerate_statedump_kernel_trace_path.XXXXXX)
 
-NUM_TESTS=11
+NUM_TESTS=13
 
 source $TESTDIR/utils/utils.sh
 
 
 source $TESTDIR/utils/utils.sh
 
@@ -41,6 +41,7 @@ print_test_banner "$TEST_DESC"
 
 check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." ||
 {
 
 check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." ||
 {
+       lttng_modules_loaded_fail
        validate_lttng_modules_present
        start_lttng_sessiond
        modprobe lttng-test
        validate_lttng_modules_present
        start_lttng_sessiond
        modprobe lttng-test
@@ -55,4 +56,5 @@ check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." ||
 
        modprobe --remove lttng-test
        stop_lttng_sessiond
 
        modprobe --remove lttng-test
        stop_lttng_sessiond
+       lttng_modules_loaded_fail
 }
 }
index e66a257a962da00ec612d81e143e133e7bfa9944..1b1eec4ea730e96a5bf2eae2e16f4e846f1224ce 100755 (executable)
@@ -12,7 +12,7 @@ EVENT_NAME="lttng_test_filter_event"
 
 TRACE_PATH=$(mktemp -d -t tmp.rotation_kernel_tracing.XXXXXX)
 
 
 TRACE_PATH=$(mktemp -d -t tmp.rotation_kernel_tracing.XXXXXX)
 
-NUM_TESTS=66
+NUM_TESTS=68
 
 source $TESTDIR/utils/utils.sh
 source $CURDIR/rotate_utils.sh
 
 source $TESTDIR/utils/utils.sh
 source $CURDIR/rotate_utils.sh
@@ -109,6 +109,7 @@ bail_out_if_no_babeltrace
 
 check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." ||
 {
 
 check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." ||
 {
+       lttng_modules_loaded_fail
        validate_lttng_modules_present
 
        start_lttng_relayd "-o $TRACE_PATH"
        validate_lttng_modules_present
 
        start_lttng_relayd "-o $TRACE_PATH"
@@ -127,6 +128,7 @@ check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." ||
        modprobe --remove lttng-test
        stop_lttng_sessiond
        stop_lttng_relayd
        modprobe --remove lttng-test
        stop_lttng_sessiond
        stop_lttng_relayd
+       lttng_modules_loaded_fail
 }
 
 rm -rf $TRACE_PATH
 }
 
 rm -rf $TRACE_PATH
index 302e5b341c0b800059a5c84750ead2de5b962714..fba44586093fa0cb4bacd2d130380920eed0d17b 100755 (executable)
@@ -14,7 +14,7 @@ CHANNEL_NAME="snapchan"
 
 TRACE_PATH=$(mktemp -d -t tmp.test_snapshots_kernel_trace_path.XXXXXX)
 
 
 TRACE_PATH=$(mktemp -d -t tmp.test_snapshots_kernel_trace_path.XXXXXX)
 
-NUM_TESTS=2061
+NUM_TESTS=2063
 
 source $TESTDIR/utils/utils.sh
 
 
 source $TESTDIR/utils/utils.sh
 
@@ -223,7 +223,7 @@ bail_out_if_no_babeltrace
 
 check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." ||
 {
 
 check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." ||
 {
-
+       lttng_modules_loaded_fail
        validate_lttng_modules_present
 
        start_lttng_sessiond
        validate_lttng_modules_present
 
        start_lttng_sessiond
@@ -245,4 +245,5 @@ check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." ||
        done
 
        stop_lttng_sessiond
        done
 
        stop_lttng_sessiond
+       lttng_modules_loaded_fail
 }
 }
index 3c78ac50bf5283fa9d9433fee3039efd895d8826..bd4925aa7ffea35792d0520a99aed768e10103ae 100755 (executable)
@@ -13,7 +13,7 @@ SESSION_NAME=""
 
 TRACE_PATH=$(mktemp -d -t tmp.test_streaming_kernel_trace_path.XXXXXX)
 
 
 TRACE_PATH=$(mktemp -d -t tmp.test_streaming_kernel_trace_path.XXXXXX)
 
-NUM_TESTS=11
+NUM_TESTS=13
 
 source $TESTDIR/utils/utils.sh
 
 
 source $TESTDIR/utils/utils.sh
 
@@ -49,6 +49,7 @@ print_test_banner "$TEST_DESC"
 
 check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." ||
 {
 
 check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." ||
 {
+       lttng_modules_loaded_fail
        validate_lttng_modules_present
 
        start_lttng_relayd "-o $TRACE_PATH"
        validate_lttng_modules_present
 
        start_lttng_relayd "-o $TRACE_PATH"
@@ -74,4 +75,5 @@ check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." ||
 
        stop_lttng_sessiond
        stop_lttng_relayd
 
        stop_lttng_sessiond
        stop_lttng_relayd
+       lttng_modules_loaded_fail
 }
 }
This page took 0.041857 seconds and 4 git commands to generate.