Skip to content

Commit 25a8238

Browse files
Paolo Abenidavem330
authored andcommitted
tc-testing: add test-cases for numeric and invalid control action
Only the police action allows us to specify an arbitrary numeric value for the control action. This change introduces an explicit test case for the above feature and then leverage it for testing the kernel behavior for invalid control actions (reject). Signed-off-by: Paolo Abeni <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 97763dc commit 25a8238

File tree

1 file changed

+48
-0
lines changed
  • tools/testing/selftests/tc-testing/tc-tests/actions

1 file changed

+48
-0
lines changed

tools/testing/selftests/tc-testing/tc-tests/actions/police.json

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,54 @@
312312
"$TC actions flush action police"
313313
]
314314
},
315+
{
316+
"id": "6aaf",
317+
"name": "Add police actions with conform-exceed control pass/pipe [with numeric values]",
318+
"category": [
319+
"actions",
320+
"police"
321+
],
322+
"setup": [
323+
[
324+
"$TC actions flush action police",
325+
0,
326+
1,
327+
255
328+
]
329+
],
330+
"cmdUnderTest": "$TC actions add action police rate 3mbit burst 250k conform-exceed 0/3 index 1",
331+
"expExitCode": "0",
332+
"verifyCmd": "$TC actions get action police index 1",
333+
"matchPattern": "action order [0-9]*: police 0x1 rate 3Mbit burst 250Kb mtu 2Kb action pass/pipe",
334+
"matchCount": "1",
335+
"teardown": [
336+
"$TC actions flush action police"
337+
]
338+
},
339+
{
340+
"id": "29b1",
341+
"name": "Add police actions with conform-exceed control <invalid>/drop",
342+
"category": [
343+
"actions",
344+
"police"
345+
],
346+
"setup": [
347+
[
348+
"$TC actions flush action police",
349+
0,
350+
1,
351+
255
352+
]
353+
],
354+
"cmdUnderTest": "$TC actions add action police rate 3mbit burst 250k conform-exceed 10/drop index 1",
355+
"expExitCode": "255",
356+
"verifyCmd": "$TC actions ls action police",
357+
"matchPattern": "action order [0-9]*: police 0x1 rate 3Mbit burst 250Kb mtu 2Kb action ",
358+
"matchCount": "0",
359+
"teardown": [
360+
"$TC actions flush action police"
361+
]
362+
},
315363
{
316364
"id": "c26f",
317365
"name": "Add police action with invalid peakrate value",

0 commit comments

Comments
 (0)