5b68e62bef68f6c75d9b84c0322b5d326e7d7e97
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"
23 SESSION_NAME
="health_tp_fail"
25 HEALTH_CHECK_BIN
="health_check"
26 SESSIOND_PRELOAD
=".libs/libhealthtpfail.so"
28 source $TESTDIR/utils.sh
30 print_test_banner
"$TEST_DESC"
32 if [ ! -f "$CURDIR/$SESSIOND_PRELOAD" ]; then
33 echo -e "libhealthtpfail.so not available for this test. Skipping."
39 test_tp_fail_name
="$1"
40 test_tp_fail_code
="$2"
43 echo -e "=== Testing health failure with ${test_tp_fail_name}"
46 export LTTNG_TESTPOINT_ENABLE
=1
48 # Activate specific testpoint failure
49 export ${test_tp_fail_name}_TP_FAIL
=1
51 # Spawn sessiond with preload healthexit lib
52 export LD_PRELOAD
="$CURDIR/$SESSIOND_PRELOAD"
55 # Cleanup some env. var.
57 unset ${test_tp_fail_name}_TP_FAIL
59 echo -n "Validating thread ${test_tp_fail_name} failure... "
61 # Check health status, exit code should indicate failure
62 $CURDIR/$HEALTH_CHECK_BIN &> /dev
/null
64 health_check_exit_code
=$?
66 if [ $health_check_exit_code -eq $test_tp_fail_code ]; then
71 echo -e "Health returned: $health_check_exit_code\n"
78 THREAD
=("LTTNG_THREAD_MANAGE_CLIENTS"
79 "LTTNG_THREAD_MANAGE_APPS"
80 "LTTNG_THREAD_MANAGE_KERNEL")
82 # Exit code value to indicate specific thread failure
85 THREAD_COUNT
=${#THREAD[@]}
87 while [ "$i" -lt "$THREAD_COUNT" ]; do
88 test_tp_fail
"${THREAD[$i]}" "${EXIT_CODE[$i]}"
97 # Special case manage consumer, need to spawn consumer via commands.
98 #"LTTNG_THREAD_MANAGE_CONSUMER"
This page took 0.031137 seconds and 3 git commands to generate.