Fix: report error to client on consumerd error
[lttng-tools.git] / tests / kernel / run-kernel-tests.sh
CommitLineData
8e0dbb65
DG
1#!/bin/bash
2
32258573 3SESSIOND_BIN="lttng-sessiond"
2e6a03f6
DG
4CURDIR=$(dirname $0)
5TESTDIR=$CURDIR/..
d3e8f6bb
DG
6
7source $TESTDIR/utils.sh
8e0dbb65
DG
8
9tmpdir=`mktemp -d`
2e6a03f6 10tests=( $CURDIR/kernel_event_basic $CURDIR/kernel_all_events_basic )
8e0dbb65
DG
11exit_code=0
12
13function start_tests ()
14{
15 for bin in ${tests[@]};
16 do
2e6a03f6
DG
17 if [ ! -e $bin ]; then
18 echo -e "$bin not found, passing"
19 continue
20 fi
21
355f483d
DG
22 start_sessiond
23
8e0dbb65
DG
24 ./$bin $tmpdir
25 # Test must return 0 to pass.
26 if [ $? -ne 0 ]; then
27 exit_code=1
355f483d 28 stop_sessiond
8e0dbb65
DG
29 break
30 fi
355f483d 31 stop_sessiond
8e0dbb65 32 done
d3e8f6bb
DG
33
34 # Cleaning up
35 rm -rf $tmpdir
8e0dbb65
DG
36}
37
38function check_lttng_modules ()
39{
84c3304d 40 local out=`lsmod | grep lttng`
8e0dbb65
DG
41 if [ -z "$out" ]; then
42 echo "LTTng modules not detected. Aborting kernel tests!"
43 echo ""
44 # Exit status 0 so the tests can continue
45 exit 0
46 fi
47}
48
355f483d
DG
49echo -e "\n---------------------"
50echo -e "Testing Kernel tracer"
51echo -e "---------------------"
8e0dbb65
DG
52
53# Detect lttng-modules installed
8e0dbb65
DG
54check_lttng_modules
55
8e0dbb65
DG
56start_tests
57
8e0dbb65 58exit $exit_code
This page took 0.026594 seconds and 4 git commands to generate.