xref: /linux/tools/testing/selftests/net/forwarding/sch_tbf_root.sh (revision 34dc1baba215b826e454b8d19e4f24adbeb7d00d)
1#!/bin/bash
2# SPDX-License-Identifier: GPL-2.0
3
4ALL_TESTS="
5	ping_ipv4
6	tbf_test
7"
8: ${lib_dir:=.}
9source $lib_dir/sch_tbf_core.sh
10
11tbf_test_one()
12{
13	local bs=$1; shift
14
15	tc qdisc replace dev $swp2 root handle 108: tbf \
16	   rate 400Mbit burst $bs limit 1M
17	do_tbf_test 10 400 $bs
18}
19
20tbf_test()
21{
22	tbf_test_one 128K
23	tc qdisc del dev $swp2 root
24}
25
26if type -t sch_tbf_pre_hook >/dev/null; then
27	sch_tbf_pre_hook
28fi
29
30trap cleanup EXIT
31
32setup_prepare
33setup_wait
34
35tests_run
36
37exit $EXIT_STATUS
38