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