tests: Move to kernel style SPDX license identifiers
[lttng-tools.git] / tests / regression / tools / save-load / test_autoload
CommitLineData
ff86d8d0
AW
1#!/bin/bash
2#
9d16b343 3# Copyright (C) 2018 Anders Wallin <wallinux@gmail.com>
ff86d8d0 4#
9d16b343 5# SPDX-License-Identifier: LGPL-2.1-only
ff86d8d0
AW
6
7TEST_DESC="Auto load session(s)"
8
9CURDIR=$(dirname $0)/
10CONFIG_DIR="${CURDIR}/configuration"
11TESTDIR=$CURDIR/../../../
ff86d8d0
AW
12export LTTNG_SESSION_CONFIG_XSD_PATH=$(readlink -m ${TESTDIR}../src/common/config/)
13
14DIR=$(readlink -f $TESTDIR)
15
16NUM_TESTS=9
17
18source $TESTDIR/utils/utils.sh
19
20# MUST set TESTDIR before calling those functions
21plan_tests $NUM_TESTS
22
23print_test_banner "$TEST_DESC"
24
25function test_auto_load_file()
26{
27 diag "Test auto load file"
28
29 start_lttng_sessiond $CURDIR/load-42.lttng
30 list_lttng_with_opts load-42
31 stop_lttng_sessiond
32}
33
34function test_auto_load_dir()
35{
36 diag "Test auto load directory"
37
38 cp -f $CURDIR/load-42.lttng $LTTNG_DIR/
39
40 start_lttng_sessiond $LTTNG_DIR
41 list_lttng_with_opts load-42
42 stop_lttng_sessiond
43}
44
45function test_auto_load_lttng_home()
46{
47 diag "Test auto load by setting LTTNG_HOME"
48
49 mkdir -p $LTTNG_HOME/.lttng/sessions/auto
50 cp -f $CURDIR/load-42.lttng $LTTNG_HOME/.lttng/sessions/auto
51
52 start_lttng_sessiond
53 list_lttng_with_opts load-42
54 stop_lttng_sessiond
55}
56
57TESTS=(
58 test_auto_load_file
59 test_auto_load_dir
60 test_auto_load_lttng_home
61)
62
63for fct_test in ${TESTS[@]};
64do
65 export LTTNG_HOME=$(mktemp -d)
66 export LTTNG_DIR=$(mktemp -d)
67
68 ${fct_test}
69 rm -rf $LTTNG_DIR
70 rm -rf $LTTNG_HOME
71 if [ $? -ne 0 ]; then
72 break;
73 fi
74done
This page took 0.033855 seconds and 5 git commands to generate.