c9ea8b8960f78ee2aed8cd13e7fc783cf24b606b
[lttng-tools.git] / tests / lttng / runall.sh
1 #!/bin/bash
2
3 SESSIOND_BIN="ltt-sessiond"
4
5 tmpdir=`mktemp -d`
6 tests=( kernel_all_events_basic )
7 exit_code=0
8
9 function start_tests ()
10 {
11 for bin in ${tests[@]};
12 do
13 ./$bin $tmpdir
14 # Test must return 0 to pass.
15 if [ $? -ne 0 ]; then
16 exit_code=1
17 break
18 fi
19 done
20 }
21
22 echo -e "\n----------------------------------"
23 echo -e "Testing lttng client (liblttngctl)"
24 echo -e "----------------------------------"
25
26 if [ -z $(pidof $SESSIOND_BIN) ]; then
27 echo -n "Starting session daemon... "
28 ../ltt-sessiond/$SESSIOND_BIN --daemonize --quiet
29 if [ $? -eq 1 ]; then
30 echo -e '\e[1;31mFAILED\e[0m'
31 rm -rf $tmpdir
32 exit 1
33 else
34 echo -e "\e[1;32mOK\e[0m"
35 fi
36 fi
37
38 PID_SESSIOND=`pidof lt-$SESSIOND_BIN`
39
40 # Simply wait for the session daemon bootstrap
41 sleep 1
42
43 start_tests
44
45 echo -e -n "\nKilling session daemon... "
46 kill $PID_SESSIOND >/dev/null 2>&1
47 if [ $? -eq 1 ]; then
48 echo -e '\e[1;31mFAILED\e[0m'
49 else
50 echo -e "\e[1;32mOK\e[0m"
51 fi
52
53 rm -rf $tmpdir
54
55 exit $exit_code
This page took 0.042371 seconds and 3 git commands to generate.