3 # SPDX-License-Identifier: GPL-2.0-only
5 # Copyright (C) EfficiOS Inc.
8 # This test verifies that generic (non-LTTng) CTF traces are output with the
9 # expected directory structure.
11 # Traces found when invoking
13 # babeltrace2 in -c sink.ctf.fs -p 'path="out"'
15 # are expected to use the same directory structure relative to `out` as the
16 # original traces had relative to `in`.
20 if [ -n "${BT_TESTS_SRCDIR:-}" ]; then
21 UTILSSH
="$BT_TESTS_SRCDIR/utils/utils.sh"
23 UTILSSH
="$(dirname "$0")/../utils/utils.sh"
26 # shellcheck source=../utils/utils.sh
31 temp_input_dir
=$
(mktemp
-t -d test-output-path-ctf-non-lttng-trace-input.XXXXXX
)
32 temp_output_dir
=$
(mktemp
-t -d test-output-path-ctf-non-lttng-trace-output.XXXXXX
)
34 mkdir
-p "${temp_input_dir}/a/b/c"
35 cp -a "${BT_CTF_TRACES_PATH}/intersection/3eventsintersect" "${temp_input_dir}/a/b/c"
37 mkdir
-p "${temp_input_dir}/a/b/c"
38 cp -a "${BT_CTF_TRACES_PATH}/intersection/3eventsintersectreverse" "${temp_input_dir}/a/b/c"
40 mkdir
-p "${temp_input_dir}/d/e/f"
41 cp -a "${BT_CTF_TRACES_PATH}/intersection/nointersect" "${temp_input_dir}/d/e/f"
43 bt_cli
"/dev/null" "/dev/null" "${temp_input_dir}" -c sink.ctf.fs
-p "path=\"${temp_output_dir}\""
45 test -f "${temp_output_dir}/a/b/c/3eventsintersect/metadata"
46 ok
"$?" "3eventsintersect output trace exists"
48 test -f "${temp_output_dir}/a/b/c/3eventsintersectreverse/metadata"
49 ok
"$?" "3eventsintersectreverse output trace exists"
51 test -f "${temp_output_dir}/d/e/f/nointersect/metadata"
52 ok
"$?" "nointersect output trace exists"
54 rm -rf "${temp_input_dir}" "${temp_output_dir}"