xref: /aosp_15_r20/external/ltp/testcases/network/tcp_cc/dctcp01.sh (revision 49cdfc7efb34551c7342be41a7384b9c40d7cab7)
1#!/bin/sh
2# SPDX-License-Identifier: GPL-2.0-or-later
3# Copyright (c) 2015-2018 Oracle and/or its affiliates. All Rights Reserved.
4#
5# Author: Alexey Kodanev <[email protected]>
6
7TST_SETUP="setup"
8TST_TESTFUNC="do_test"
9TST_CLEANUP="cleanup"
10TST_MIN_KVER="3.18"
11
12cleanup()
13{
14	tc qdisc del dev $(tst_iface) root netem loss 0.5% ecn
15
16	tcp_cc_cleanup
17}
18
19setup()
20{
21	tcp_cc_check_support dctcp
22	tcp_cc_setup
23
24	tst_res TINFO "emulate congestion with packet loss 0.5% and ECN"
25	tc qdisc add dev $(tst_iface) root netem loss 0.5% ecn > /dev/null 2>&1
26
27	if [ $? -ne 0 ]; then
28		tst_brk TCONF "netem doesn't support ECN"
29	fi
30}
31
32do_test()
33{
34	tcp_cc_test01 dctcp 10
35}
36
37. tcp_cc_lib.sh
38tst_run
39