Skip to content

Commit

Permalink
tc-testing: updated police, mirred, skbedit and skbmod with more tests
Browse files Browse the repository at this point in the history
Added extra test cases for control actions (reclassify, pipe etc.),
cookies, max index value and police args sanity check.

Signed-off-by: Roman Mashak <mrv@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Roman Mashak authored and davem330 committed Mar 26, 2018
1 parent 9e09686 commit 808679e
Show file tree
Hide file tree
Showing 4 changed files with 528 additions and 0 deletions.
192 changes: 192 additions & 0 deletions tools/testing/selftests/tc-testing/tc-tests/actions/mirred.json
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,198 @@
"$TC actions flush action mirred"
]
},
{
"id": "8917",
"name": "Add mirred mirror action with control pass",
"category": [
"actions",
"mirred"
],
"setup": [
[
"$TC actions flush action mirred",
0,
1,
255
]
],
"cmdUnderTest": "$TC actions add action mirred ingress mirror dev lo pass index 1",
"expExitCode": "0",
"verifyCmd": "$TC actions get action mirred index 1",
"matchPattern": "action order [0-9]*: mirred \\(Ingress Mirror to device lo\\) pass.*index 1 ref",
"matchCount": "1",
"teardown": [
"$TC actions flush action mirred"
]
},
{
"id": "1054",
"name": "Add mirred mirror action with control pipe",
"category": [
"actions",
"mirred"
],
"setup": [
[
"$TC actions flush action mirred",
0,
1,
255
]
],
"cmdUnderTest": "$TC actions add action mirred ingress mirror dev lo pipe index 15",
"expExitCode": "0",
"verifyCmd": "$TC actions get action mirred index 15",
"matchPattern": "action order [0-9]*: mirred \\(Ingress Mirror to device lo\\) pipe.*index 15 ref",
"matchCount": "1",
"teardown": [
"$TC actions flush action mirred"
]
},
{
"id": "9887",
"name": "Add mirred mirror action with control continue",
"category": [
"actions",
"mirred"
],
"setup": [
[
"$TC actions flush action mirred",
0,
1,
255
]
],
"cmdUnderTest": "$TC actions add action mirred ingress mirror dev lo continue index 15",
"expExitCode": "0",
"verifyCmd": "$TC actions get action mirred index 15",
"matchPattern": "action order [0-9]*: mirred \\(Ingress Mirror to device lo\\) continue.*index 15 ref",
"matchCount": "1",
"teardown": [
"$TC actions flush action mirred"
]
},
{
"id": "e4aa",
"name": "Add mirred mirror action with control reclassify",
"category": [
"actions",
"mirred"
],
"setup": [
[
"$TC actions flush action mirred",
0,
1,
255
]
],
"cmdUnderTest": "$TC actions add action mirred ingress mirror dev lo reclassify index 150",
"expExitCode": "0",
"verifyCmd": "$TC actions get action mirred index 150",
"matchPattern": "action order [0-9]*: mirred \\(Ingress Mirror to device lo\\) reclassify.*index 150 ref",
"matchCount": "1",
"teardown": [
"$TC actions flush action mirred"
]
},
{
"id": "ece9",
"name": "Add mirred mirror action with control drop",
"category": [
"actions",
"mirred"
],
"setup": [
[
"$TC actions flush action mirred",
0,
1,
255
]
],
"cmdUnderTest": "$TC actions add action mirred ingress mirror dev lo drop index 99",
"expExitCode": "0",
"verifyCmd": "$TC actions get action mirred index 99",
"matchPattern": "action order [0-9]*: mirred \\(Ingress Mirror to device lo\\) drop.*index 99 ref",
"matchCount": "1",
"teardown": [
"$TC actions flush action mirred"
]
},
{
"id": "0031",
"name": "Add mirred mirror action with control jump",
"category": [
"actions",
"mirred"
],
"setup": [
[
"$TC actions flush action mirred",
0,
1,
255
]
],
"cmdUnderTest": "$TC actions add action mirred ingress mirror dev lo jump 10 index 99",
"expExitCode": "0",
"verifyCmd": "$TC actions get action mirred index 99",
"matchPattern": "action order [0-9]*: mirred \\(Ingress Mirror to device lo\\) jump 10.*index 99 ref",
"matchCount": "1",
"teardown": [
"$TC actions flush action mirred"
]
},
{
"id": "407c",
"name": "Add mirred mirror action with cookie",
"category": [
"actions",
"mirred"
],
"setup": [
[
"$TC actions flush action mirred",
0,
1,
255
]
],
"cmdUnderTest": "$TC actions add action mirred ingress mirror dev lo reclassify cookie aa11bb22cc33dd44ee55",
"expExitCode": "0",
"verifyCmd": "$TC actions ls action mirred",
"matchPattern": "action order [0-9]*: mirred \\(Ingress Mirror to device lo\\) reclassify.*cookie aa11bb22cc33dd44ee55",
"matchCount": "1",
"teardown": [
"$TC actions flush action mirred"
]
},
{
"id": "8b69",
"name": "Add mirred mirror action with maximum index",
"category": [
"actions",
"mirred"
],
"setup": [
[
"$TC actions flush action mirred",
0,
1,
255
]
],
"cmdUnderTest": "$TC actions add action mirred ingress mirror dev lo pipe index 4294967295",
"expExitCode": "0",
"verifyCmd": "$TC actions get action mirred index 4294967295",
"matchPattern": "action order [0-9]*: mirred \\(Ingress Mirror to device lo\\) pipe.*index 4294967295",
"matchCount": "1",
"teardown": [
"$TC actions flush action mirred"
]
},
{
"id": "a70e",
"name": "Delete mirred mirror action",
Expand Down
144 changes: 144 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 @@ -264,6 +264,150 @@
"$TC actions flush action police"
]
},
{
"id": "ddd6",
"name": "Add police action with invalid rate value",
"category": [
"actions",
"police"
],
"setup": [
[
"$TC actions flush action police",
0,
1,
255
]
],
"cmdUnderTest": "$TC actions add action police rate 3tb burst 250k conform-exceed pass/pipe index 5",
"expExitCode": "255",
"verifyCmd": "$TC actions ls action police",
"matchPattern": "action order [0-9]*: police 0x5 rate 3Tb burst 250Kb mtu 2Kb action pass/pipe",
"matchCount": "0",
"teardown": [
"$TC actions flush action police"
]
},
{
"id": "f61c",
"name": "Add police action with invalid burst value",
"category": [
"actions",
"police"
],
"setup": [
[
"$TC actions flush action police",
0,
1,
255
]
],
"cmdUnderTest": "$TC actions add action police rate 3kbit burst 250P conform-exceed pass/pipe index 5",
"expExitCode": "255",
"verifyCmd": "$TC actions ls action police",
"matchPattern": "action order [0-9]*: police 0x5 rate 3Kbit burst 250Pb mtu 2Kb action pass/pipe",
"matchCount": "0",
"teardown": [
"$TC actions flush action police"
]
},
{
"id": "c26f",
"name": "Add police action with invalid peakrate value",
"category": [
"actions",
"police"
],
"setup": [
[
"$TC actions flush action police",
0,
1,
255
]
],
"cmdUnderTest": "$TC actions add action police rate 90kbit burst 10k mtu 2kb peakrate 100T index 1",
"expExitCode": "255",
"verifyCmd": "$TC actions ls action police",
"matchPattern": "action order [0-9]*: police 0x1 rate 90Kbit burst 10Kb mtu 2Kb peakrate 100Tbit",
"matchCount": "0",
"teardown": [
"$TC actions flush action police"
]
},
{
"id": "db04",
"name": "Add police action with invalid mtu value",
"category": [
"actions",
"police"
],
"setup": [
[
"$TC actions flush action police",
0,
1,
255
]
],
"cmdUnderTest": "$TC actions add action police rate 10kbit burst 10k mtu 2Pbit index 1",
"expExitCode": "255",
"verifyCmd": "$TC actions ls action police",
"matchPattern": "action order [0-9]*: police 0x1 rate 10Kbit burst 1Kb mtu 2Pb",
"matchCount": "0",
"teardown": [
"$TC actions flush action police"
]
},
{
"id": "f3c9",
"name": "Add police action with cookie",
"category": [
"actions",
"police"
],
"setup": [
[
"$TC actions flush action police",
0,
1,
255
]
],
"cmdUnderTest": "$TC actions add action police rate 10mbit burst 10k index 1 cookie a1b1c1d1e1f12233bb",
"expExitCode": "0",
"verifyCmd": "$TC actions get action police index 1",
"matchPattern": "action order [0-9]*: police 0x1 rate 10Mbit burst 10Kb mtu 2Kb.*cookie a1b1c1d1e1f12233bb",
"matchCount": "1",
"teardown": [
"$TC actions flush action police"
]
},
{
"id": "d190",
"name": "Add police action with maximum index",
"category": [
"actions",
"police"
],
"setup": [
[
"$TC actions flush action police",
0,
1,
255
]
],
"cmdUnderTest": "$TC actions add action police rate 10mbit burst 10k index 4294967295",
"expExitCode": "0",
"verifyCmd": "$TC actions get action mirred index 4294967295",
"matchPattern": "action order [0-9]*: police 0xffffffff rate 10Mbit burst 10Kb mtu 2Kb",
"matchCount": "1",
"teardown": [
"$TC actions flush action mirred"
]
},
{
"id": "336e",
"name": "Delete police action",
Expand Down
Loading

0 comments on commit 808679e

Please sign in to comment.