Skip to content

Commit

Permalink
selftests/tc-testing: add selftests for skbprio qdisc
Browse files Browse the repository at this point in the history
Test 283e: Create skbprio with default setting
Test c086: Create skbprio with limit setting
Test 6733: Change skbprio with limit setting
Test 2958: Show skbprio 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 0158f65 commit c5a2d86
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 0 deletions.
1 change: 1 addition & 0 deletions tools/testing/selftests/tc-testing/config
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ CONFIG_NET_SCH_PRIO=m
CONFIG_NET_SCH_INGRESS=m
CONFIG_NET_SCH_SFB=m
CONFIG_NET_SCH_SFQ=m
CONFIG_NET_SCH_SKBPRIO=m

#
# Classification
Expand Down
95 changes: 95 additions & 0 deletions tools/testing/selftests/tc-testing/tc-tests/qdiscs/skbprio.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
[
{
"id": "283e",
"name": "Create skbprio with default setting",
"category": [
"qdisc",
"skbprio"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
"$IP link add dev $DUMMY type dummy || /bin/true"
],
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root skbprio",
"expExitCode": "0",
"verifyCmd": "$TC qdisc show dev $DUMMY",
"matchPattern": "qdisc skbprio 1: root refcnt [0-9]+ limit 64",
"matchCount": "1",
"teardown": [
"$TC qdisc del dev $DUMMY handle 1: root",
"$IP link del dev $DUMMY type dummy"
]
},
{
"id": "c086",
"name": "Create skbprio with limit setting",
"category": [
"qdisc",
"skbprio"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
"$IP link add dev $DUMMY type dummy || /bin/true"
],
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root skbprio limit 1",
"expExitCode": "0",
"verifyCmd": "$TC qdisc show dev $DUMMY",
"matchPattern": "qdisc skbprio 1: root refcnt [0-9]+ limit 1",
"matchCount": "1",
"teardown": [
"$TC qdisc del dev $DUMMY handle 1: root",
"$IP link del dev $DUMMY type dummy"
]
},
{
"id": "6733",
"name": "Change skbprio with limit setting",
"category": [
"qdisc",
"skbprio"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
"$IP link add dev $DUMMY type dummy || /bin/true",
"$TC qdisc add dev $DUMMY handle 1: root skbprio"
],
"cmdUnderTest": "$TC qdisc change dev $DUMMY handle 1: root skbprio limit 32",
"expExitCode": "0",
"verifyCmd": "$TC qdisc show dev $DUMMY",
"matchPattern": "qdisc skbprio 1: root refcnt [0-9]+ limit 32",
"matchCount": "1",
"teardown": [
"$TC qdisc del dev $DUMMY handle 1: root",
"$IP link del dev $DUMMY type dummy"
]
},
{
"id": "2958",
"name": "Show skbprio class",
"category": [
"qdisc",
"skbprio"
],
"plugins": {
"requires": "nsPlugin"
},
"setup": [
"$IP link add dev $DUMMY type dummy || /bin/true"
],
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root skbprio",
"expExitCode": "0",
"verifyCmd": "$TC class show dev $DUMMY",
"matchPattern": "class skbprio 1:",
"matchCount": "64",
"teardown": [
"$TC qdisc del dev $DUMMY handle 1: root",
"$IP link del dev $DUMMY type dummy"
]
}
]

0 comments on commit c5a2d86

Please sign in to comment.