| 1 | #!/bin/bash |
| 2 | # |
| 3 | # SPDX-License-Identifier: GPL-2.0-only |
| 4 | # |
| 5 | # Copyright (C) 2019 Francis Deslauriers <francis.deslauriers@efficios.com> |
| 6 | # |
| 7 | |
| 8 | # This file tests what happens when we mux messages. |
| 9 | |
| 10 | SH_TAP=1 |
| 11 | |
| 12 | if [ -n "${BT_TESTS_SRCDIR:-}" ]; then |
| 13 | UTILSSH="$BT_TESTS_SRCDIR/utils/utils.sh" |
| 14 | else |
| 15 | UTILSSH="$(dirname "$0")/../../../utils/utils.sh" |
| 16 | fi |
| 17 | |
| 18 | # shellcheck source=../../../utils/utils.sh |
| 19 | source "$UTILSSH" |
| 20 | |
| 21 | data_dir="$BT_TESTS_DATADIR/plugins/flt.utils.muxer" |
| 22 | |
| 23 | plan_tests 12 |
| 24 | |
| 25 | function run_test |
| 26 | { |
| 27 | local test_name="$1" |
| 28 | local local_args=( |
| 29 | "--plugin-path" "$data_dir" |
| 30 | "-c" "src.test-muxer.TheSourceOfConfusion" |
| 31 | "-p" "test-name=$test_name" |
| 32 | "-c" "sink.text.details" |
| 33 | "--params=compact=false,with-metadata=false" |
| 34 | ) |
| 35 | |
| 36 | stdout_expected="$data_dir/succeed/$test_name.expect" |
| 37 | bt_diff_cli "$stdout_expected" /dev/null "${local_args[@]}" |
| 38 | ok $? "$test_name" |
| 39 | } |
| 40 | |
| 41 | |
| 42 | test_cases=( |
| 43 | basic-timestamp-ordering |
| 44 | diff-event-class-id |
| 45 | diff-event-class-name |
| 46 | diff-inactivity-msg-cs |
| 47 | diff-stream-class-id |
| 48 | diff-stream-class-name |
| 49 | diff-stream-class-no-name |
| 50 | diff-stream-id |
| 51 | diff-stream-name |
| 52 | diff-stream-no-name |
| 53 | diff-trace-name |
| 54 | multi-iter-ordering |
| 55 | ) |
| 56 | |
| 57 | for i in "${test_cases[@]}" |
| 58 | do |
| 59 | run_test "$i" |
| 60 | done |