Tests: Fix: Use '.logfile' instead of '.log' for test app output
[lttng-tools.git] / tests / regression / tools / regen-statedump / test_kernel
1 #!/bin/bash
2 #
3 # Copyright (C) 2016 Julien Desfossez <jdesfossez@efficios.com>
4 #
5 # SPDX-License-Identifier: LGPL-2.1-only
6
7 TEST_DESC="Regenerate the statedump - Kernel tracing"
8
9 CURDIR=$(dirname $0)/
10 TESTDIR=$CURDIR/../../..
11 EVENT_NAME="lttng_test_filter_event"
12 SESSION_NAME=""
13 EVENT_NAME="lttng_statedump_start,lttng_statedump_end"
14
15 TRACE_PATH=$(mktemp -d -t tmp.test_regenerate_statedump_kernel_trace_path.XXXXXX)
16
17 NUM_TESTS=11
18
19 source $TESTDIR/utils/utils.sh
20
21 function test_kernel_local ()
22 {
23 diag "Test kernel local with statedump regeneration"
24 create_lttng_session_ok $SESSION_NAME $TRACE_PATH
25 lttng_enable_kernel_event $SESSION_NAME $EVENT_NAME
26 start_lttng_tracing_ok $SESSION_NAME
27 echo -n "100" > /proc/lttng-test-filter-event
28 regenerate_statedump_ok $SESSION_NAME
29 stop_lttng_tracing_ok $SESSION_NAME
30 validate_trace_count $EVENT_NAME $TRACE_PATH 4
31 if [ $? -eq 0 ]; then
32 # Only delete if successful
33 rm -rf $TRACE_PATH
34 fi
35 destroy_lttng_session_ok $SESSION_NAME
36 }
37
38 plan_tests $NUM_TESTS
39
40 print_test_banner "$TEST_DESC"
41
42 check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." ||
43 {
44 validate_lttng_modules_present
45 start_lttng_sessiond
46 modprobe lttng-test
47
48 tests=( test_kernel_local )
49
50 for fct_test in ${tests[@]};
51 do
52 SESSION_NAME=$(randstring 16 0)
53 ${fct_test}
54 done
55
56 modprobe --remove lttng-test
57 stop_lttng_sessiond
58 }
This page took 0.03794 seconds and 5 git commands to generate.