341a9c26eaa3a2e1af9cd0e1dab329ee0f058562
3 # SPDX-License-Identifier: GPL-2.0-only
5 # Copyright (C) 2015 Julien Desfossez <jdesfossez@efficios.com>
10 if [ -n "${BT_TESTS_SRCDIR:-}" ]; then
11 UTILSSH
="$BT_TESTS_SRCDIR/utils/utils.sh"
13 UTILSSH
="$(dirname "$0")/../utils/utils.sh"
16 # shellcheck source=../utils/utils.sh
26 "${BT_TESTS_BT2_BIN}" "$trace" >/dev
/null
2>&1
28 "${BT_TESTS_BT2_BIN}" "$trace" 2>&1 >/dev
/null |
"${BT_TESTS_GREP_BIN}" "\[warning\] Tracer lost"
30 fail
1 "Should not find any lost events"
38 local expectedcountstr
=$2
40 "${BT_TESTS_BT2_BIN}" "$trace" >/dev
/null
2>&1
43 # Convert warnings like:
44 # WARNING: Tracer discarded 2 trace packets between ....
45 # WARNING: Tracer discarded 3 trace packets between ....
46 # into "2,3" and make sure it matches the expected result
47 "${BT_TESTS_BT2_BIN}" "$trace" 2>&1 >/dev
/null |
"${BT_TESTS_GREP_BIN}" "WARNING: Tracer discarded" \
48 | cut
-d" " -f4 |
tr "\n" "," |
"${BT_TESTS_SED_BIN}" "s/.$//" | \
49 "${BT_TESTS_GREP_BIN}" "$expectedcountstr" >/dev
/null
50 ok $?
"Lost events string matches $expectedcountstr"
54 diag
"Test the packet_seq_num validation"
57 test_no_lost
"${BT_CTF_TRACES_PATH}/packet_seq_num/no_lost"
59 diag
"No packet lost, packet_seq_num not starting at 0"
60 test_no_lost
"${BT_CTF_TRACES_PATH}/packet_seq_num/no_lost_not_starting_at_0"
62 diag
"1 stream, 2 packets lost before the last packet"
63 test_lost
"${BT_CTF_TRACES_PATH}/packet_seq_num/2_lost_before_last" "2"
65 diag
"2 streams, packets lost in one of them"
66 test_lost
"${BT_CTF_TRACES_PATH}/packet_seq_num/2_streams_lost_in_1" "2"
68 diag
"2 streams, packets lost in both"
69 test_lost
"${BT_CTF_TRACES_PATH}/packet_seq_num/2_streams_lost_in_2" "2,3,1"
This page took 0.032603 seconds and 3 git commands to generate.