-
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 sfb qdisc
Test 3294: Create SFB with default setting Test 430a: Create SFB with rehash setting Test 3410: Create SFB with db setting Test 49a0: Create SFB with limit setting Test 1241: Create SFB with max setting Test 3249: Create SFB with target setting Test 30a9: Create SFB with increment setting Test 239a: Create SFB with decrement setting Test 9301: Create SFB with penalty_rate setting Test 2a01: Create SFB with penalty_burst setting Test 3209: Change SFB with rehash setting Test 5447: Show SFB 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
7d0b4b0
commit 6ad92dc
Showing
2 changed files
with
280 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
279 changes: 279 additions & 0 deletions
279
tools/testing/selftests/tc-testing/tc-tests/qdiscs/sfb.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,279 @@ | ||
[ | ||
{ | ||
"id": "3294", | ||
"name": "Create SFB with default setting", | ||
"category": [ | ||
"qdisc", | ||
"sfb" | ||
], | ||
"plugins": { | ||
"requires": "nsPlugin" | ||
}, | ||
"setup": [ | ||
"$IP link add dev $DUMMY type dummy || /bin/true" | ||
], | ||
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root sfb", | ||
"expExitCode": "0", | ||
"verifyCmd": "$TC qdisc show dev $DUMMY", | ||
"matchPattern": "qdisc sfb 1: root refcnt [0-9]+ rehash 600s db 60s", | ||
"matchCount": "1", | ||
"teardown": [ | ||
"$TC qdisc del dev $DUMMY handle 1: root", | ||
"$IP link del dev $DUMMY type dummy" | ||
] | ||
}, | ||
{ | ||
"id": "430a", | ||
"name": "Create SFB with rehash setting", | ||
"category": [ | ||
"qdisc", | ||
"sfb" | ||
], | ||
"plugins": { | ||
"requires": "nsPlugin" | ||
}, | ||
"setup": [ | ||
"$IP link add dev $DUMMY type dummy || /bin/true" | ||
], | ||
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root sfb rehash 60", | ||
"expExitCode": "0", | ||
"verifyCmd": "$TC qdisc show dev $DUMMY", | ||
"matchPattern": "qdisc sfb 1: root refcnt [0-9]+ rehash 60ms db 60s", | ||
"matchCount": "1", | ||
"teardown": [ | ||
"$TC qdisc del dev $DUMMY handle 1: root", | ||
"$IP link del dev $DUMMY type dummy" | ||
] | ||
}, | ||
{ | ||
"id": "3410", | ||
"name": "Create SFB with db setting", | ||
"category": [ | ||
"qdisc", | ||
"sfb" | ||
], | ||
"plugins": { | ||
"requires": "nsPlugin" | ||
}, | ||
"setup": [ | ||
"$IP link add dev $DUMMY type dummy || /bin/true" | ||
], | ||
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root sfb db 10", | ||
"expExitCode": "0", | ||
"verifyCmd": "$TC qdisc show dev $DUMMY", | ||
"matchPattern": "qdisc sfb 1: root refcnt [0-9]+ rehash 600s db 10ms", | ||
"matchCount": "1", | ||
"teardown": [ | ||
"$TC qdisc del dev $DUMMY handle 1: root", | ||
"$IP link del dev $DUMMY type dummy" | ||
] | ||
}, | ||
{ | ||
"id": "49a0", | ||
"name": "Create SFB with limit setting", | ||
"category": [ | ||
"qdisc", | ||
"sfb" | ||
], | ||
"plugins": { | ||
"requires": "nsPlugin" | ||
}, | ||
"setup": [ | ||
"$IP link add dev $DUMMY type dummy || /bin/true" | ||
], | ||
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root sfb limit 100", | ||
"expExitCode": "0", | ||
"verifyCmd": "$TC qdisc show dev $DUMMY", | ||
"matchPattern": "qdisc sfb 1: root refcnt [0-9]+ rehash 600s db 60s limit 100p", | ||
"matchCount": "1", | ||
"teardown": [ | ||
"$TC qdisc del dev $DUMMY handle 1: root", | ||
"$IP link del dev $DUMMY type dummy" | ||
] | ||
}, | ||
{ | ||
"id": "1241", | ||
"name": "Create SFB with max setting", | ||
"category": [ | ||
"qdisc", | ||
"sfb" | ||
], | ||
"plugins": { | ||
"requires": "nsPlugin" | ||
}, | ||
"setup": [ | ||
"$IP link add dev $DUMMY type dummy || /bin/true" | ||
], | ||
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root sfb max 100", | ||
"expExitCode": "0", | ||
"verifyCmd": "$TC qdisc show dev $DUMMY", | ||
"matchPattern": "qdisc sfb 1: root refcnt 2 rehash 600s db 60s.*max 100p", | ||
"matchCount": "1", | ||
"teardown": [ | ||
"$TC qdisc del dev $DUMMY handle 1: root", | ||
"$IP link del dev $DUMMY type dummy" | ||
] | ||
}, | ||
{ | ||
"id": "3249", | ||
"name": "Create SFB with target setting", | ||
"category": [ | ||
"qdisc", | ||
"sfb" | ||
], | ||
"plugins": { | ||
"requires": "nsPlugin" | ||
}, | ||
"setup": [ | ||
"$IP link add dev $DUMMY type dummy || /bin/true" | ||
], | ||
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root sfb target 100", | ||
"expExitCode": "0", | ||
"verifyCmd": "$TC qdisc show dev $DUMMY", | ||
"matchPattern": "qdisc sfb 1: root refcnt 2 rehash 600s db 60s.*target 100p", | ||
"matchCount": "1", | ||
"teardown": [ | ||
"$TC qdisc del dev $DUMMY handle 1: root", | ||
"$IP link del dev $DUMMY type dummy" | ||
] | ||
}, | ||
{ | ||
"id": "30a9", | ||
"name": "Create SFB with increment setting", | ||
"category": [ | ||
"qdisc", | ||
"sfb" | ||
], | ||
"plugins": { | ||
"requires": "nsPlugin" | ||
}, | ||
"setup": [ | ||
"$IP link add dev $DUMMY type dummy || /bin/true" | ||
], | ||
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root sfb increment 0.1", | ||
"expExitCode": "0", | ||
"verifyCmd": "$TC qdisc show dev $DUMMY", | ||
"matchPattern": "qdisc sfb 1: root refcnt 2 rehash 600s db 60s.*increment 0.1", | ||
"matchCount": "1", | ||
"teardown": [ | ||
"$TC qdisc del dev $DUMMY handle 1: root", | ||
"$IP link del dev $DUMMY type dummy" | ||
] | ||
}, | ||
{ | ||
"id": "239a", | ||
"name": "Create SFB with decrement setting", | ||
"category": [ | ||
"qdisc", | ||
"sfb" | ||
], | ||
"plugins": { | ||
"requires": "nsPlugin" | ||
}, | ||
"setup": [ | ||
"$IP link add dev $DUMMY type dummy || /bin/true" | ||
], | ||
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root sfb decrement 0.1", | ||
"expExitCode": "0", | ||
"verifyCmd": "$TC qdisc show dev $DUMMY", | ||
"matchPattern": "qdisc sfb 1: root refcnt 2 rehash 600s db 60s.*decrement 0.1", | ||
"matchCount": "1", | ||
"teardown": [ | ||
"$TC qdisc del dev $DUMMY handle 1: root", | ||
"$IP link del dev $DUMMY type dummy" | ||
] | ||
}, | ||
{ | ||
"id": "9301", | ||
"name": "Create SFB with penalty_rate setting", | ||
"category": [ | ||
"qdisc", | ||
"sfb" | ||
], | ||
"plugins": { | ||
"requires": "nsPlugin" | ||
}, | ||
"setup": [ | ||
"$IP link add dev $DUMMY type dummy || /bin/true" | ||
], | ||
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root sfb penalty_rate 4000", | ||
"expExitCode": "0", | ||
"verifyCmd": "$TC qdisc show dev $DUMMY", | ||
"matchPattern": "qdisc sfb 1: root refcnt 2 rehash 600s db 60s.*penalty_rate 4000pps", | ||
"matchCount": "1", | ||
"teardown": [ | ||
"$TC qdisc del dev $DUMMY handle 1: root", | ||
"$IP link del dev $DUMMY type dummy" | ||
] | ||
}, | ||
{ | ||
"id": "2a01", | ||
"name": "Create SFB with penalty_burst setting", | ||
"category": [ | ||
"qdisc", | ||
"sfb" | ||
], | ||
"plugins": { | ||
"requires": "nsPlugin" | ||
}, | ||
"setup": [ | ||
"$IP link add dev $DUMMY type dummy || /bin/true" | ||
], | ||
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root sfb penalty_burst 64", | ||
"expExitCode": "0", | ||
"verifyCmd": "$TC qdisc show dev $DUMMY", | ||
"matchPattern": "qdisc sfb 1: root refcnt 2 rehash 600s db 60s.*penalty_burst 64p", | ||
"matchCount": "1", | ||
"teardown": [ | ||
"$TC qdisc del dev $DUMMY handle 1: root", | ||
"$IP link del dev $DUMMY type dummy" | ||
] | ||
}, | ||
{ | ||
"id": "3209", | ||
"name": "Change SFB with rehash setting", | ||
"category": [ | ||
"qdisc", | ||
"sfb" | ||
], | ||
"plugins": { | ||
"requires": "nsPlugin" | ||
}, | ||
"setup": [ | ||
"$IP link add dev $DUMMY type dummy || /bin/true", | ||
"$TC qdisc add dev $DUMMY handle 1: root sfb penalty_burst 64" | ||
], | ||
"cmdUnderTest": "$TC qdisc change dev $DUMMY handle 1: root sfb rehash 100", | ||
"expExitCode": "0", | ||
"verifyCmd": "$TC qdisc show dev $DUMMY", | ||
"matchPattern": "qdisc sfb 1: root refcnt 2 rehash 100ms db 60s", | ||
"matchCount": "1", | ||
"teardown": [ | ||
"$TC qdisc del dev $DUMMY handle 1: root", | ||
"$IP link del dev $DUMMY type dummy" | ||
] | ||
}, | ||
{ | ||
"id": "5447", | ||
"name": "Show SFB class", | ||
"category": [ | ||
"qdisc", | ||
"sfb" | ||
], | ||
"plugins": { | ||
"requires": "nsPlugin" | ||
}, | ||
"setup": [ | ||
"$IP link add dev $DUMMY type dummy || /bin/true" | ||
], | ||
"cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root sfb", | ||
"expExitCode": "0", | ||
"verifyCmd": "$TC class show dev $DUMMY", | ||
"matchPattern": "class sfb 1:", | ||
"matchCount": "0", | ||
"teardown": [ | ||
"$TC qdisc del dev $DUMMY handle 1: root", | ||
"$IP link del dev $DUMMY type dummy" | ||
] | ||
} | ||
] |