Fix tests when lttng-ust is disabled
[lttng-tools.git] / tests / kernel / run-kernel-tests.sh
... / ...
CommitLineData
1#!/bin/bash
2
3SESSIOND_BIN="lttng-sessiond"
4TESTDIR=$(dirname $0)/..
5
6source $TESTDIR/utils.sh
7
8tmpdir=`mktemp -d`
9tests=( kernel_event_basic kernel_all_events_basic )
10exit_code=0
11
12function 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
32function 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
43echo -e "\n---------------------"
44echo -e "Testing Kernel tracer"
45echo -e "---------------------"
46
47# Detect lttng-modules installed
48check_lttng_modules
49
50start_tests
51
52exit $exit_code
This page took 0.022401 seconds and 4 git commands to generate.