Tests: Convert the kernel_all_events_basic test to an equivalent shell test
[lttng-tools.git] / tests / regression / kernel / run-kernel-tests.sh
... / ...
CommitLineData
1#!/bin/bash
2
3SESSIOND_BIN="lttng-sessiond"
4CURDIR=$(dirname $0)
5TESTDIR=$CURDIR/../..
6
7source $TESTDIR/utils/utils.sh
8
9tmpdir=`mktemp -d`
10tests=( $CURDIR/kernel_event_basic $CURDIR/kernel_all_events_basic )
11exit_code=0
12
13function start_tests ()
14{
15 for bin in ${tests[@]};
16 do
17 if [ ! -e $bin ]; then
18 echo -e "$bin not found, passing"
19 continue
20 fi
21
22 start_lttng_sessiond
23
24 ./$bin $tmpdir
25 # Test must return 0 to pass.
26 if [ $? -ne 0 ]; then
27 exit_code=1
28 stop_lttng_sessiond
29 break
30 fi
31 stop_lttng_sessiond
32 done
33
34 # Cleaning up
35 rm -rf $tmpdir
36}
37
38function check_lttng_modules ()
39{
40 local out=`ls /lib/modules/$(uname -r)/extra | grep lttng`
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
49
50TEST_DESC="Testing Kernel tracer"
51
52print_test_banner "$TEST_DESC"
53
54# Detect lttng-modules installed
55check_lttng_modules
56
57start_tests
58
59exit $exit_code
This page took 0.022279 seconds and 4 git commands to generate.