Commit | Line | Data |
---|---|---|
005d49d6 | 1 | #!/bin/bash |
005d49d6 | 2 | # |
0235b0db | 3 | # SPDX-License-Identifier: GPL-2.0-only |
005d49d6 | 4 | # |
0235b0db | 5 | # Copyright (C) EfficiOS Inc. |
005d49d6 | 6 | # |
005d49d6 SM |
7 | |
8 | # This test verifies that generic (non-LTTng) CTF traces are output with the | |
9 | # expected directory structure. | |
10 | # | |
11 | # Traces found when invoking | |
12 | # | |
13 | # babeltrace2 in -c sink.ctf.fs -p 'path="out"' | |
14 | # | |
15 | # are expected to use the same directory structure relative to `out` as the | |
16 | # original traces had relative to `in`. | |
17 | ||
18 | SH_TAP=1 | |
19 | ||
75e396f6 | 20 | if [ -n "${BT_TESTS_SRCDIR:-}" ]; then |
005d49d6 SM |
21 | UTILSSH="$BT_TESTS_SRCDIR/utils/utils.sh" |
22 | else | |
23 | UTILSSH="$(dirname "$0")/../utils/utils.sh" | |
24 | fi | |
25 | ||
26 | # shellcheck source=../utils/utils.sh | |
27 | source "$UTILSSH" | |
28 | ||
29 | plan_tests 3 | |
30 | ||
7132b838 PP |
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) | |
005d49d6 SM |
33 | |
34 | mkdir -p "${temp_input_dir}/a/b/c" | |
35 | cp -a "${BT_CTF_TRACES_PATH}/intersection/3eventsintersect" "${temp_input_dir}/a/b/c" | |
36 | ||
37 | mkdir -p "${temp_input_dir}/a/b/c" | |
38 | cp -a "${BT_CTF_TRACES_PATH}/intersection/3eventsintersectreverse" "${temp_input_dir}/a/b/c" | |
39 | ||
40 | mkdir -p "${temp_input_dir}/d/e/f" | |
41 | cp -a "${BT_CTF_TRACES_PATH}/intersection/nointersect" "${temp_input_dir}/d/e/f" | |
42 | ||
e9b03bd9 | 43 | bt_cli "/dev/null" "/dev/null" "${temp_input_dir}" -c sink.ctf.fs -p "path=\"${temp_output_dir}\"" |
005d49d6 SM |
44 | |
45 | test -f "${temp_output_dir}/a/b/c/3eventsintersect/metadata" | |
46 | ok "$?" "3eventsintersect output trace exists" | |
47 | ||
48 | test -f "${temp_output_dir}/a/b/c/3eventsintersectreverse/metadata" | |
49 | ok "$?" "3eventsintersectreverse output trace exists" | |
50 | ||
51 | test -f "${temp_output_dir}/d/e/f/nointersect/metadata" | |
52 | ok "$?" "nointersect output trace exists" | |
53 | ||
54 | rm -rf "${temp_input_dir}" "${temp_output_dir}" |