Refactor: test: wrapper for destroy_lttng_session
[lttng-tools.git] / tests / regression / kernel / test_all_events
CommitLineData
a3ed20b4
CB
1#!/bin/bash
2#
3# Copyright (C) - 2013 Christian Babeux <christian.babeux@efficios.com>
4#
5# This program is free software; you can redistribute it and/or modify it
6# under the terms of the GNU General Public License, version 2 only, as
7# published by the Free Software Foundation.
8#
9# This program is distributed in the hope that it will be useful, but WITHOUT
10# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12# more details.
13#
14# You should have received a copy of the GNU General Public License along with
15# this program; if not, write to the Free Software Foundation, Inc., 51
16# Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17
18TEST_DESC="Kernel tracer - All events"
19
20CURDIR=$(dirname $0)/
21TESTDIR=$CURDIR/../..
22NUM_TESTS=8
23
24source $TESTDIR/utils/utils.sh
25
a3ed20b4
CB
26function test_all_event()
27{
28 TRACE_PATH=$(mktemp -d)
29 SESSION_NAME="kernel_all_events_basic"
30
bf6ae429 31 create_lttng_session_ok $SESSION_NAME $TRACE_PATH
a3ed20b4
CB
32
33 lttng_enable_kernel_event $SESSION_NAME
34
e563bbdb 35 start_lttng_tracing_ok
96340a01 36 stop_lttng_tracing_ok
a3ed20b4
CB
37
38 validate_trace "sched_switch" $TRACE_PATH
39
67b4c664 40 destroy_lttng_session_ok $SESSION_NAME
a3ed20b4
CB
41
42 rm -rf $TRACE_PATH
43}
44
45# MUST set TESTDIR before calling those functions
46plan_tests $NUM_TESTS
47
e3bef725
CB
48print_test_banner "$TEST_DESC"
49
a3ed20b4
CB
50if [ "$(id -u)" == "0" ]; then
51 isroot=1
52else
53 isroot=0
54fi
55
56skip $isroot "Root access is needed. Skipping all tests." $NUM_TESTS ||
57{
58 start_lttng_sessiond
59
60 test_all_event
61
62 stop_lttng_sessiond
63}
This page took 0.035168 seconds and 5 git commands to generate.