c7db62488f7bb42b00dd5e35c50ce7bc59e60dce
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_fail_code
="$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
56 # Check health status, exit code should indicate failure
57 $CURDIR/$HEALTH_CHECK_BIN &> /dev
/null
59 health_check_exit_code
=$?
61 if [ $health_check_exit_code -eq $test_tp_fail_code ]; then
62 pass
"Validate thread ${test_tp_fail_name} failure"
65 fail
"Validate thread ${test_tp_fail_name} failure"
66 diag
"Health returned: $health_check_exit_code"
74 print_test_banner
"$TEST_DESC"
76 THREAD
=("LTTNG_THREAD_MANAGE_CLIENTS"
77 "LTTNG_THREAD_MANAGE_APPS")
79 # Exit code value to indicate specific thread failure
82 THREAD_COUNT
=${#THREAD[@]}
84 while [ "$i" -lt "$THREAD_COUNT" ]; do
85 test_tp_fail
"${THREAD[$i]}" "${EXIT_CODE[$i]}"
94 # The manage kernel thread is only spawned if we are root
95 if [ "$(id -u)" == "0" ]; then
101 skip
$isroot "Root access is needed. Skipping LTTNG_THREAD_MANAGE_KERNEL tests." "3" ||
103 test_tp_fail
"LTTNG_THREAD_MANAGE_KERNEL" "8"
107 # TODO: Special case manage consumer, need to spawn consumer via commands.
108 #"LTTNG_THREAD_MANAGE_CONSUMER"
This page took 0.031681 seconds and 4 git commands to generate.