mirror of
https://github.com/torvalds/linux.git
synced 2024-11-29 23:51:37 +00:00
selftests/tc-testing: add selftests for gred qdisc
Test 8942: Create GRED with default setting Test 5783: Create GRED with grio setting Test 8a09: Create GRED with limit setting Test 48cb: Create GRED with ecn setting Test 763a: Change GRED setting Test 8309: Show GRED class Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
9e274718cc
commit
a4a8d3562b
@ -17,6 +17,7 @@ CONFIG_NET_SCH_CHOKE=m
|
||||
CONFIG_NET_SCH_CODEL=m
|
||||
CONFIG_NET_SCH_ETF=m
|
||||
CONFIG_NET_SCH_FQ=m
|
||||
CONFIG_NET_SCH_GRED=m
|
||||
CONFIG_NET_SCH_PRIO=m
|
||||
CONFIG_NET_SCH_INGRESS=m
|
||||
|
||||
|
164
tools/testing/selftests/tc-testing/tc-tests/qdiscs/gred.json
Normal file
164
tools/testing/selftests/tc-testing/tc-tests/qdiscs/gred.json
Normal file
@ -0,0 +1,164 @@
|
||||
[
|
||||
{
|
||||
"id": "8942",
|
||||
"name": "Create GRED with default setting",
|
||||
"category": [
|
||||
"qdisc",
|
||||
"gred"
|
||||
],
|
||||
"plugins": {
|
||||
"requires": "nsPlugin"
|
||||
},
|
||||
"setup": [
|
||||
"$IP link add dev $DUMMY type dummy || /bin/true"
|
||||
],
|
||||
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root gred setup vqs 10 default 1",
|
||||
"expExitCode": "0",
|
||||
"verifyCmd": "$TC qdisc show dev $DUMMY",
|
||||
"matchPattern": "qdisc gred 1: root refcnt [0-9]+ vqs 10 default 1",
|
||||
"matchCount": "1",
|
||||
"teardown": [
|
||||
"$TC qdisc del dev $DUMMY handle 1: root",
|
||||
"$IP link del dev $DUMMY type dummy"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "5783",
|
||||
"name": "Create GRED with grio setting",
|
||||
"category": [
|
||||
"qdisc",
|
||||
"gred"
|
||||
],
|
||||
"plugins": {
|
||||
"requires": "nsPlugin"
|
||||
},
|
||||
"setup": [
|
||||
"$IP link add dev $DUMMY type dummy || /bin/true"
|
||||
],
|
||||
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root gred setup vqs 10 default 1 grio",
|
||||
"expExitCode": "0",
|
||||
"verifyCmd": "$TC qdisc show dev $DUMMY",
|
||||
"matchPattern": "qdisc gred 1: root refcnt [0-9]+ vqs 10 default 1.*grio",
|
||||
"matchCount": "1",
|
||||
"teardown": [
|
||||
"$TC qdisc del dev $DUMMY handle 1: root",
|
||||
"$IP link del dev $DUMMY type dummy"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "8a09",
|
||||
"name": "Create GRED with limit setting",
|
||||
"category": [
|
||||
"qdisc",
|
||||
"gred"
|
||||
],
|
||||
"plugins": {
|
||||
"requires": "nsPlugin"
|
||||
},
|
||||
"setup": [
|
||||
"$IP link add dev $DUMMY type dummy || /bin/true"
|
||||
],
|
||||
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root gred setup vqs 10 default 1 limit 1000",
|
||||
"expExitCode": "0",
|
||||
"verifyCmd": "$TC qdisc show dev $DUMMY",
|
||||
"matchPattern": "qdisc gred 1: root refcnt [0-9]+ vqs 10 default 1 limit 1000b",
|
||||
"matchCount": "1",
|
||||
"teardown": [
|
||||
"$TC qdisc del dev $DUMMY handle 1: root",
|
||||
"$IP link del dev $DUMMY type dummy"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "48ca",
|
||||
"name": "Create GRED with ecn setting",
|
||||
"category": [
|
||||
"qdisc",
|
||||
"gred"
|
||||
],
|
||||
"plugins": {
|
||||
"requires": "nsPlugin"
|
||||
},
|
||||
"setup": [
|
||||
"$IP link add dev $DUMMY type dummy || /bin/true"
|
||||
],
|
||||
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root gred setup vqs 10 default 2 ecn",
|
||||
"expExitCode": "0",
|
||||
"verifyCmd": "$TC qdisc show dev $DUMMY",
|
||||
"matchPattern": "qdisc gred 1: root refcnt [0-9]+ vqs 10 default 2.*ecn",
|
||||
"matchCount": "1",
|
||||
"teardown": [
|
||||
"$TC qdisc del dev $DUMMY handle 1: root",
|
||||
"$IP link del dev $DUMMY type dummy"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "48cb",
|
||||
"name": "Create GRED with harddrop setting",
|
||||
"category": [
|
||||
"qdisc",
|
||||
"gred"
|
||||
],
|
||||
"plugins": {
|
||||
"requires": "nsPlugin"
|
||||
},
|
||||
"setup": [
|
||||
"$IP link add dev $DUMMY type dummy || /bin/true"
|
||||
],
|
||||
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root gred setup vqs 10 default 2 harddrop",
|
||||
"expExitCode": "0",
|
||||
"verifyCmd": "$TC qdisc show dev $DUMMY",
|
||||
"matchPattern": "qdisc gred 1: root refcnt [0-9]+ vqs 10 default 2.*harddrop",
|
||||
"matchCount": "1",
|
||||
"teardown": [
|
||||
"$TC qdisc del dev $DUMMY handle 1: root",
|
||||
"$IP link del dev $DUMMY type dummy"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "763a",
|
||||
"name": "Change GRED setting",
|
||||
"category": [
|
||||
"qdisc",
|
||||
"gred"
|
||||
],
|
||||
"plugins": {
|
||||
"requires": "nsPlugin"
|
||||
},
|
||||
"setup": [
|
||||
"$IP link add dev $DUMMY type dummy || /bin/true",
|
||||
"$TC qdisc add dev $DUMMY handle 1: root gred setup vqs 10 default 1"
|
||||
],
|
||||
"cmdUnderTest": "$TC qdisc change dev $DUMMY handle 1: root gred limit 60KB min 15K max 25K burst 64 avpkt 1500 bandwidth 10Mbit DP 1 probability 0.1",
|
||||
"expExitCode": "0",
|
||||
"verifyCmd": "$TC qdisc show dev $DUMMY",
|
||||
"matchPattern": "qdisc gred 1: root refcnt [0-9]+ vqs 10 default 1 limit.*vq 1 prio [0-9]+ limit 60Kb min 15Kb max 25Kb",
|
||||
"matchCount": "1",
|
||||
"teardown": [
|
||||
"$TC qdisc del dev $DUMMY handle 1: root",
|
||||
"$IP link del dev $DUMMY type dummy"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "8309",
|
||||
"name": "Show GRED class",
|
||||
"category": [
|
||||
"qdisc",
|
||||
"gred"
|
||||
],
|
||||
"plugins": {
|
||||
"requires": "nsPlugin"
|
||||
},
|
||||
"setup": [
|
||||
"$IP link add dev $DUMMY type dummy || /bin/true"
|
||||
],
|
||||
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root gred setup vqs 10 default 1",
|
||||
"expExitCode": "0",
|
||||
"verifyCmd": "$TC class show dev $DUMMY",
|
||||
"matchPattern": "class gred 1:",
|
||||
"matchCount": "0",
|
||||
"teardown": [
|
||||
"$TC qdisc del dev $DUMMY handle 1: root",
|
||||
"$IP link del dev $DUMMY type dummy"
|
||||
]
|
||||
}
|
||||
]
|
Loading…
Reference in New Issue
Block a user