tests: test_output_path_ctf_non_lttng_trace_output small improvements
[babeltrace.git] / tests / cli / test_output_path_ctf_non_lttng_trace
CommitLineData
005d49d6
SM
1#!/bin/bash
2
3# Copyright (C) EfficiOS Inc.
4#
5# This program is free software; you can redistribute it and/or
6# modify it under the terms of the GNU General Public License
7# as published by the Free Software Foundation; only version 2
8# of the License.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program; if not, write to the Free Software
17# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18
19# This test verifies that generic (non-LTTng) CTF traces are output with the
20# expected directory structure.
21#
22# Traces found when invoking
23#
24# babeltrace2 in -c sink.ctf.fs -p 'path="out"'
25#
26# are expected to use the same directory structure relative to `out` as the
27# original traces had relative to `in`.
28
29SH_TAP=1
30
31if [ "x${BT_TESTS_SRCDIR:-}" != "x" ]; then
32 UTILSSH="$BT_TESTS_SRCDIR/utils/utils.sh"
33else
34 UTILSSH="$(dirname "$0")/../utils/utils.sh"
35fi
36
37# shellcheck source=../utils/utils.sh
38source "$UTILSSH"
39
40plan_tests 3
41
e9b03bd9
SM
42temp_input_dir=$(mktemp -t -d test_output_path_ctf_non_lttng_trace_input.XXXXXX)
43temp_output_dir=$(mktemp -t -d test_output_path_ctf_non_lttng_trace_output.XXXXXX)
005d49d6
SM
44
45mkdir -p "${temp_input_dir}/a/b/c"
46cp -a "${BT_CTF_TRACES_PATH}/intersection/3eventsintersect" "${temp_input_dir}/a/b/c"
47
48mkdir -p "${temp_input_dir}/a/b/c"
49cp -a "${BT_CTF_TRACES_PATH}/intersection/3eventsintersectreverse" "${temp_input_dir}/a/b/c"
50
51mkdir -p "${temp_input_dir}/d/e/f"
52cp -a "${BT_CTF_TRACES_PATH}/intersection/nointersect" "${temp_input_dir}/d/e/f"
53
e9b03bd9 54bt_cli "/dev/null" "/dev/null" "${temp_input_dir}" -c sink.ctf.fs -p "path=\"${temp_output_dir}\""
005d49d6
SM
55
56test -f "${temp_output_dir}/a/b/c/3eventsintersect/metadata"
57ok "$?" "3eventsintersect output trace exists"
58
59test -f "${temp_output_dir}/a/b/c/3eventsintersectreverse/metadata"
60ok "$?" "3eventsintersectreverse output trace exists"
61
62test -f "${temp_output_dir}/d/e/f/nointersect/metadata"
63ok "$?" "nointersect output trace exists"
64
65rm -rf "${temp_input_dir}" "${temp_output_dir}"
This page took 0.024823 seconds and 4 git commands to generate.