Skip to content

Commit

Permalink
selftests: tc-testing: add action police selftest for packets per second
Browse files Browse the repository at this point in the history
Add selftest cases in action police for packets per second.
These tests depend on corresponding iproute2 command support.

Signed-off-by: Baowen Zheng <baowen.zheng@corigine.com>
Signed-off-by: Simon Horman <simon.horman@netronome.com>
Reviewed-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Baowen Zheng authored and David S. Miller committed Mar 29, 2021
1 parent a7fd0e6 commit c127ffa
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions tools/testing/selftests/tc-testing/tc-tests/actions/police.json
Original file line number Diff line number Diff line change
Expand Up @@ -764,5 +764,53 @@
"teardown": [
"$TC actions flush action police"
]
},
{
"id": "cdd7",
"name": "Add valid police action with packets per second rate limit",
"category": [
"actions",
"police"
],
"setup": [
[
"$TC actions flush action police",
0,
1,
255
]
],
"cmdUnderTest": "$TC actions add action police pkts_rate 1000 pkts_burst 200 index 1",
"expExitCode": "0",
"verifyCmd": "$TC actions ls action police",
"matchPattern": "action order [0-9]*: police 0x1 rate 0bit burst 0b mtu 4096Mb pkts_rate 1000 pkts_burst 200",
"matchCount": "1",
"teardown": [
"$TC actions flush action police"
]
},
{
"id": "f5bc",
"name": "Add invalid police action with both bps and pps",
"category": [
"actions",
"police"
],
"setup": [
[
"$TC actions flush action police",
0,
1,
255
]
],
"cmdUnderTest": "$TC actions add action police rate 1kbit burst 10k pkts_rate 1000 pkts_burst 200 index 1",
"expExitCode": "255",
"verifyCmd": "$TC actions ls action police",
"matchPattern": "action order [0-9]*: police 0x1 ",
"matchCount": "0",
"teardown": [
"$TC actions flush action police"
]
}
]

0 comments on commit c127ffa

Please sign in to comment.