xref: /aosp_15_r20/external/ltp/testcases/network/tcp_cc/bbr02.sh (revision 49cdfc7efb34551c7342be41a7384b9c40d7cab7)
1#!/bin/sh
2# SPDX-License-Identifier: GPL-2.0-or-later
3# Copyright (c) 2018-2020 Oracle and/or its affiliates. All Rights Reserved.
4
5TST_SETUP="setup"
6TST_TESTFUNC="do_test"
7TST_CLEANUP="cleanup"
8TST_MIN_KVER="4.13"
9TST_TEST_DATA="pfifo_fast codel pfifo fq hfsc hhf htb pie prio sfb sfq"
10TST_CLEANUP="cleanup"
11
12cleanup()
13{
14	tc qdisc del dev $(tst_iface) root netem > /dev/null 2>&1
15
16	tcp_cc_cleanup
17}
18
19setup()
20{
21	tcp_cc_check_support bbr
22	tcp_cc_setup
23
24	local emu_opts="delay 5ms 1ms 20% loss 0.3% ecn corrupt \
250.1% reorder 93% 50% limit 10000"
26
27	tst_res TINFO "emulate congestion with packet $emu_opts"
28	ROD tc qdisc add dev $(tst_iface) root netem $emu_opts
29}
30
31do_test()
32{
33	tcp_cc_set_qdisc $2 || return
34	tcp_cc_test01 bbr -100
35}
36
37. tcp_cc_lib.sh
38tst_run
39