-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
selftests/tc-testing: add selftests for tbf qdisc
Test 6430: Create TBF with default setting Test 0518: Create TBF with mtu setting Test 320a: Create TBF with peakrate setting Test 239b: Create TBF with latency setting Test c975: Create TBF with overhead setting Test 948c: Create TBF with linklayer setting Test 3549: Replace TBF with mtu Test f948: Change TBF with latency time Test 2348: Show TBF class Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
- Loading branch information
Zhengchao Shao
authored and
David S. Miller
committed
Sep 28, 2022
1 parent
8a3b366
commit 10835be
Showing
2 changed files
with
212 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
211 changes: 211 additions & 0 deletions
211
tools/testing/selftests/tc-testing/tc-tests/qdiscs/tbf.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,211 @@ | ||
[ | ||
{ | ||
"id": "6430", | ||
"name": "Create TBF with default setting", | ||
"category": [ | ||
"qdisc", | ||
"tbf" | ||
], | ||
"plugins": { | ||
"requires": "nsPlugin" | ||
}, | ||
"setup": [ | ||
"$IP link add dev $DUMMY type dummy || /bin/true" | ||
], | ||
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root tbf limit 1000 burst 1500 rate 10000", | ||
"expExitCode": "0", | ||
"verifyCmd": "$TC qdisc show dev $DUMMY", | ||
"matchPattern": "qdisc tbf 1: root refcnt [0-9]+ rate 10Kbit burst 1500b limit 1000b", | ||
"matchCount": "1", | ||
"teardown": [ | ||
"$TC qdisc del dev $DUMMY handle 1: root", | ||
"$IP link del dev $DUMMY type dummy" | ||
] | ||
}, | ||
{ | ||
"id": "0518", | ||
"name": "Create TBF with mtu setting", | ||
"category": [ | ||
"qdisc", | ||
"tbf" | ||
], | ||
"plugins": { | ||
"requires": "nsPlugin" | ||
}, | ||
"setup": [ | ||
"$IP link add dev $DUMMY type dummy || /bin/true" | ||
], | ||
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root tbf limit 1000 burst 1500 rate 20000 mtu 2048", | ||
"expExitCode": "0", | ||
"verifyCmd": "$TC qdisc show dev $DUMMY", | ||
"matchPattern": "qdisc tbf 1: root refcnt [0-9]+ rate 20Kbit burst 1500b limit 1000b", | ||
"matchCount": "1", | ||
"teardown": [ | ||
"$TC qdisc del dev $DUMMY handle 1: root", | ||
"$IP link del dev $DUMMY type dummy" | ||
] | ||
}, | ||
{ | ||
"id": "320a", | ||
"name": "Create TBF with peakrate setting", | ||
"category": [ | ||
"qdisc", | ||
"tbf" | ||
], | ||
"plugins": { | ||
"requires": "nsPlugin" | ||
}, | ||
"setup": [ | ||
"$IP link add dev $DUMMY type dummy || /bin/true" | ||
], | ||
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root tbf limit 1000 burst 1500 rate 20000 mtu 1510 peakrate 30000", | ||
"expExitCode": "0", | ||
"verifyCmd": "$TC qdisc show dev $DUMMY", | ||
"matchPattern": "qdisc tbf 1: root refcnt [0-9]+ rate 20Kbit burst 1500b peakrate 30Kbit minburst.*limit 1000b", | ||
"matchCount": "1", | ||
"teardown": [ | ||
"$TC qdisc del dev $DUMMY handle 1: root", | ||
"$IP link del dev $DUMMY type dummy" | ||
] | ||
}, | ||
{ | ||
"id": "239b", | ||
"name": "Create TBF with latency setting", | ||
"category": [ | ||
"qdisc", | ||
"tbf" | ||
], | ||
"plugins": { | ||
"requires": "nsPlugin" | ||
}, | ||
"setup": [ | ||
"$IP link add dev $DUMMY type dummy || /bin/true" | ||
], | ||
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root tbf burst 1500 rate 20000 latency 100ms", | ||
"expExitCode": "0", | ||
"verifyCmd": "$TC qdisc show dev $DUMMY", | ||
"matchPattern": "qdisc tbf 1: root refcnt [0-9]+ rate 20Kbit burst 1500b lat 100ms", | ||
"matchCount": "1", | ||
"teardown": [ | ||
"$TC qdisc del dev $DUMMY handle 1: root", | ||
"$IP link del dev $DUMMY type dummy" | ||
] | ||
}, | ||
{ | ||
"id": "c975", | ||
"name": "Create TBF with overhead setting", | ||
"category": [ | ||
"qdisc", | ||
"tbf" | ||
], | ||
"plugins": { | ||
"requires": "nsPlugin" | ||
}, | ||
"setup": [ | ||
"$IP link add dev $DUMMY type dummy || /bin/true" | ||
], | ||
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root tbf limit 1000 burst 1500 rate 20000 overhead 300", | ||
"expExitCode": "0", | ||
"verifyCmd": "$TC qdisc show dev $DUMMY", | ||
"matchPattern": "qdisc tbf 1: root refcnt [0-9]+ rate 20Kbit burst 1800b limit 1000b overhead 300", | ||
"matchCount": "1", | ||
"teardown": [ | ||
"$TC qdisc del dev $DUMMY handle 1: root", | ||
"$IP link del dev $DUMMY type dummy" | ||
] | ||
}, | ||
{ | ||
"id": "948c", | ||
"name": "Create TBF with linklayer setting", | ||
"category": [ | ||
"qdisc", | ||
"tbf" | ||
], | ||
"plugins": { | ||
"requires": "nsPlugin" | ||
}, | ||
"setup": [ | ||
"$IP link add dev $DUMMY type dummy || /bin/true" | ||
], | ||
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root tbf limit 1000 burst 1500 rate 20000 linklayer atm", | ||
"expExitCode": "0", | ||
"verifyCmd": "$TC qdisc show dev $DUMMY", | ||
"matchPattern": "qdisc tbf 1: root refcnt [0-9]+ rate 20Kbit burst 1696b limit 1000b linklayer atm", | ||
"matchCount": "1", | ||
"teardown": [ | ||
"$TC qdisc del dev $DUMMY handle 1: root", | ||
"$IP link del dev $DUMMY type dummy" | ||
] | ||
}, | ||
{ | ||
"id": "3549", | ||
"name": "Replace TBF with mtu", | ||
"category": [ | ||
"qdisc", | ||
"tbf" | ||
], | ||
"plugins": { | ||
"requires": "nsPlugin" | ||
}, | ||
"setup": [ | ||
"$IP link add dev $DUMMY type dummy || /bin/true", | ||
"$TC qdisc add dev $DUMMY handle 1: root tbf limit 1000 burst 1500 rate 20000 linklayer atm" | ||
], | ||
"cmdUnderTest": "$TC qdisc replace dev $DUMMY handle 1: root tbf limit 1000 burst 1500 rate 20000 linklayer ethernet", | ||
"expExitCode": "0", | ||
"verifyCmd": "$TC qdisc show dev $DUMMY", | ||
"matchPattern": "qdisc tbf 1: root refcnt [0-9]+ rate 20Kbit burst 1500b limit 1000b", | ||
"matchCount": "1", | ||
"teardown": [ | ||
"$TC qdisc del dev $DUMMY handle 1: root", | ||
"$IP link del dev $DUMMY type dummy" | ||
] | ||
}, | ||
{ | ||
"id": "f948", | ||
"name": "Change TBF with latency time", | ||
"category": [ | ||
"qdisc", | ||
"tbf" | ||
], | ||
"plugins": { | ||
"requires": "nsPlugin" | ||
}, | ||
"setup": [ | ||
"$IP link add dev $DUMMY type dummy || /bin/true", | ||
"$TC qdisc add dev $DUMMY handle 1: root tbf burst 1500 rate 20000 latency 10ms" | ||
], | ||
"cmdUnderTest": "$TC qdisc change dev $DUMMY handle 1: root tbf burst 1500 rate 20000 latency 200ms", | ||
"expExitCode": "0", | ||
"verifyCmd": "$TC qdisc show dev $DUMMY", | ||
"matchPattern": "qdisc tbf 1: root refcnt [0-9]+ rate 20Kbit burst 1500b lat 200ms", | ||
"matchCount": "1", | ||
"teardown": [ | ||
"$TC qdisc del dev $DUMMY handle 1: root", | ||
"$IP link del dev $DUMMY type dummy" | ||
] | ||
}, | ||
{ | ||
"id": "2348", | ||
"name": "Show TBF class", | ||
"category": [ | ||
"qdisc", | ||
"tbf" | ||
], | ||
"plugins": { | ||
"requires": "nsPlugin" | ||
}, | ||
"setup": [ | ||
"$IP link add dev $DUMMY type dummy || /bin/true" | ||
], | ||
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root tbf limit 1000 burst 1500 rate 10000", | ||
"expExitCode": "0", | ||
"verifyCmd": "$TC class show dev $DUMMY", | ||
"matchPattern": "class tbf.*parent 1:", | ||
"matchCount": "1", | ||
"teardown": [ | ||
"$TC qdisc del dev $DUMMY handle 1: root", | ||
"$IP link del dev $DUMMY type dummy" | ||
] | ||
} | ||
] |