Typo: 'toogle' -> 'toggle'
[lttng-tools.git] / tests / regression / tools / notification / test_notification_multi_app
index 0a05ea6a0a8e3114fd758a8d0cb7e6e18f160e8b..cfecd26c3dc80912c1a90a6f83f62c6107c003f5 100755 (executable)
@@ -1,19 +1,8 @@
 #!/bin/bash
 #
-# Copyright (C) 2017 Jonathan Rajotte <jonathan.rajotte-julien@efficiso.com>>
+# Copyright (C) 2017 Jonathan Rajotte <jonathan.rajotte-julien@efficiso.com>>
 #
-# This library is free software; you can redistribute it and/or modify it under
-# the terms of the GNU Lesser General Public License as published by the Free
-# Software Foundation; version 2.1 of the License.
-#
-# This library is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
-# details.
-#
-# You should have received a copy of the GNU Lesser General Public License
-# along with this library; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
+# SPDX-License-Identifier: LGPL-2.1-only
 
 TEST_DESC="Notification"
 
@@ -54,7 +43,7 @@ print_test_banner "$TEST_DESC"
 
 app_pids=()
 
-function kernel_event_generator_toogle_state
+function kernel_event_generator_toggle_state
 {
        kernel_event_generator_suspended=$((kernel_event_generator_suspended==0))
 
@@ -63,8 +52,8 @@ function kernel_event_generator
 {
        state_file=$1
        kernel_event_generator_suspended=0
-       trap kernel_event_generator_toogle_state SIGUSR1
-       trap "exit" SIGTERM SIGINT
+       trap kernel_event_generator_toggle_state SIGUSR1
+
        while (true); do
                if [[ $kernel_event_generator_suspended -eq "1" ]]; then
                        touch $state_file
@@ -78,7 +67,7 @@ function kernel_event_generator
        done
 }
 
-function ust_event_generator_toogle_state
+function ust_event_generator_toggle_state
 {
        ust_event_generator_suspended=$((ust_event_generator_suspended==0))
 
@@ -87,7 +76,7 @@ function ust_event_generator
 {
        state_file=$1
        ust_event_generator_suspended=0
-       trap ust_event_generator_toogle_state SIGUSR1
+       trap ust_event_generator_toggle_state SIGUSR1
        trap "exit" SIGTERM SIGINT
        while (true); do
                if [[ $ust_event_generator_suspended -eq "1" ]]; then
@@ -97,7 +86,7 @@ function ust_event_generator
                        if [[ -f $state_file ]]; then
                                rm $state_file 2> /dev/null
                        fi
-                       taskset  -c 0 $TESTAPP_BIN $NR_ITER $NR_USEC_WAIT > /dev/null 2>&1
+                       taskset  -c 0 $TESTAPP_BIN -i $NR_ITER -w $NR_USEC_WAIT > /dev/null 2>&1
                fi
        done
 }
@@ -265,7 +254,7 @@ function test_multi_app ()
                        resume_consumerd "${pipe}"
                done
                # Stop tracing forcing full buffer consumption
-               stop_lttng_tracing $SESSION_NAME
+               stop_lttng_tracing_ok $SESSION_NAME
 
                # Check for notifications reception
                wait_for_message $output_dir "${low_output_file_pattern}" "notification: low $i"
@@ -315,7 +304,7 @@ function test_multi_app_ust ()
 
        test_multi_app ust $generator_pid
 
-       kill -9 $generator_pid 2> /dev/null
+       kill -s SIGTERM $generator_pid 2> /dev/null
        wait $generator_pid 2> /dev/null
        rm -rf ${TESTAPP_STATE_FILE} 2> /dev/null
 }
@@ -331,7 +320,7 @@ function test_multi_app_kernel ()
        test_multi_app kernel $generator_pid
 
 
-       kill -9 $generator_pid 2>/dev/null
+       kill -s SIGTERM $generator_pid 2> /dev/null
        wait $generator_pid 2> /dev/null
        rm -rf ${TESTAPP_STATE_FILE} 2> /dev/null
 
@@ -348,7 +337,7 @@ function test_on_register_evaluation_ust ()
 
        test_on_register_evaluation ust $generator_pid
 
-       kill -9 $generator_pid 2> /dev/null
+       kill -s SIGTERM $generator_pid 2> /dev/null
        wait $generator_pid 2> /dev/null
        rm -rf ${TESTAPP_STATE_FILE} 2> /dev/null
 
@@ -366,7 +355,7 @@ function test_on_register_evaluation_kernel()
        test_on_register_evaluation kernel $generator_pid
 
 
-       kill -9 $generator_pid 2> /dev/null
+       kill -s SIGTERM $generator_pid 2> /dev/null
        wait $generator_pid 2> /dev/null
        rm -rf ${TESTAPP_STATE_FILE} 2> /dev/null
 
@@ -458,7 +447,7 @@ function test_on_register_evaluation ()
        destroy_lttng_session_ok $SESSION_NAME
        stop_lttng_sessiond
 
-       kill -9 $generator_pid
+       kill -s SIGTERM $generator_pid 2> /dev/null
        wait $generator_pid 2> /dev/null
 
        for pipe in "${consumerd_pipe[@]}"; do
@@ -474,6 +463,7 @@ TESTS=(
 )
 
 if [ "$(id -u)" == "0" ]; then
+       validate_lttng_modules_present
        TESTS+=(
        test_multi_app_kernel
        test_on_register_evaluation_kernel
This page took 0.02586 seconds and 5 git commands to generate.