3 # Copyright (C) - 2012 Christian Babeux <christian.babeux@efficios.com>
5 # This program is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License, version 2 only, as
7 # published by the Free Software Foundation.
9 # This program is distributed in the hope that it will be useful, but WITHOUT
10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 # You should have received a copy of the GNU General Public License along with
15 # this program; if not, write to the Free Software Foundation, Inc., 51
16 # Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 TEST_DESC
="Health check - Testpoint failure"
21 TESTDIR
=$CURDIR/..
/..
/..
23 SESSION_NAME
="health_tp_fail"
25 HEALTH_CHECK_BIN
="health_check"
26 SESSIOND_PRELOAD
=".libs/libhealthtpfail.so"
29 source $TESTDIR/utils
/utils.sh
31 if [ ! -f "$CURDIR/$SESSIOND_PRELOAD" ]; then
32 BAIL_OUT
"libhealthtpfail.so not available for this test."
37 test_tp_fail_name
="$1"
38 test_tp_error_string
="$2"
40 diag
"Test health failure with ${test_tp_fail_name}"
43 export LTTNG_TESTPOINT_ENABLE
=1
45 # Activate specific testpoint failure
46 export ${test_tp_fail_name}_TP_FAIL
=1
48 # Spawn sessiond with preload healthexit lib
49 export LD_PRELOAD
="$CURDIR/$SESSIOND_PRELOAD"
52 # Cleanup some env. var.
54 unset ${test_tp_fail_name}_TP_FAIL
57 $CURDIR/$HEALTH_CHECK_BIN > ${STDOUT_PATH} 2> ${STDERR_PATH}
59 out
=$
(grep "${test_tp_error_string}" ${STDOUT_PATH} |
wc -l)
60 if [ $out -eq 0 ]; then
61 fail
"Validate thread ${test_tp_fail_name} failure"
62 diag
"Health returned:"
79 pass
"Validate thread ${test_tp_fail_name} failure"
86 print_test_banner
"$TEST_DESC"
88 THREAD
=("LTTNG_SESSIOND_THREAD_MANAGE_CLIENTS"
89 "LTTNG_SESSIOND_THREAD_MANAGE_APPS")
92 "Thread \"Session daemon command\" is not responding in component \"sessiond\"."
93 "Thread \"Session daemon application manager\" is not responding in component \"sessiond\"."
99 THREAD_COUNT
=${#THREAD[@]}
101 while [ "$i" -lt "$THREAD_COUNT" ]; do
102 test_tp_fail
"${THREAD[$i]}" "${ERROR_STRING[$i]}"
104 if [ $?
-eq 1 ]; then
111 # The manage kernel thread is only spawned if we are root
112 if [ "$(id -u)" == "0" ]; then
118 skip
$isroot "Root access is needed. Skipping LTTNG_SESSIOND_THREAD_MANAGE_KERNEL tests." "3" ||
120 test_tp_fail
"LTTNG_SESSIOND_THREAD_MANAGE_KERNEL" "Thread \"Session daemon kernel\" is not responding in component \"sessiond\"."
126 # TODO: Special case manage consumer, need to spawn consumer via commands.
127 #"LTTNG_SESSIOND_THREAD_MANAGE_CONSUMER"
This page took 0.034006 seconds and 5 git commands to generate.