tc-testing: updated pedit TDC tests

Added test cases for IP header operations:
- set tos/precedence
- add value to tos/precedence
- clear tos/precedence
- invert tos/precedence

Signed-off-by: Roman Mashak <mrv@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Roman Mashak 2019-10-19 09:45:53 -04:00 committed by David S. Miller
parent 7170debecd
commit a8fad5459d

View File

@ -846,6 +846,206 @@
"$TC actions flush action pedit"
]
},
{
"id": "cc8a",
"name": "Add pedit action with LAYERED_OP ip set tos",
"category": [
"actions",
"pedit",
"layered_op"
],
"setup": [
[
"$TC actions flush action pedit",
0,
1,
255
]
],
"cmdUnderTest": "$TC actions add action pedit munge ip tos set 0x4 continue",
"expExitCode": "0",
"verifyCmd": "$TC actions list action pedit",
"matchPattern": "action order [0-9]+: pedit action continue keys 1.*key #0 at 0: val 00040000 mask ff00ffff",
"matchCount": "1",
"teardown": [
"$TC actions flush action pedit"
]
},
{
"id": "7a17",
"name": "Add pedit action with LAYERED_OP ip set precedence",
"category": [
"actions",
"pedit",
"layered_op"
],
"setup": [
[
"$TC actions flush action pedit",
0,
1,
255
]
],
"cmdUnderTest": "$TC actions add action pedit munge ip precedence set 3 jump 2",
"expExitCode": "0",
"verifyCmd": "$TC actions list action pedit",
"matchPattern": "action order [0-9]+: pedit action jump 2 keys 1.*key #0 at 0: val 00030000 mask ff00ffff",
"matchCount": "1",
"teardown": [
"$TC actions flush action pedit"
]
},
{
"id": "c3b6",
"name": "Add pedit action with LAYERED_OP ip add tos",
"category": [
"actions",
"pedit",
"layered_op"
],
"setup": [
[
"$TC actions flush action pedit",
0,
1,
255
]
],
"cmdUnderTest": "$TC actions add action pedit ex munge ip tos add 0x1 pass",
"expExitCode": "0",
"verifyCmd": "$TC actions list action pedit",
"matchPattern": "action order [0-9]+: pedit action pass keys 1.*key #0 at ipv4\\+0: val 00010000 mask ff00ffff",
"matchCount": "1",
"teardown": [
"$TC actions flush action pedit"
]
},
{
"id": "43d3",
"name": "Add pedit action with LAYERED_OP ip add precedence",
"category": [
"actions",
"pedit",
"layered_op"
],
"setup": [
[
"$TC actions flush action pedit",
0,
1,
255
]
],
"cmdUnderTest": "$TC actions add action pedit ex munge ip precedence add 0x1 pipe",
"expExitCode": "0",
"verifyCmd": "$TC actions list action pedit",
"matchPattern": "action order [0-9]+: pedit action pipe keys 1.*key #0 at ipv4\\+0: val 00010000 mask ff00ffff",
"matchCount": "1",
"teardown": [
"$TC actions flush action pedit"
]
},
{
"id": "438e",
"name": "Add pedit action with LAYERED_OP ip clear tos",
"category": [
"actions",
"pedit",
"layered_op"
],
"setup": [
[
"$TC actions flush action pedit",
0,
1,
255
]
],
"cmdUnderTest": "$TC actions add action pedit munge ip tos clear continue",
"expExitCode": "0",
"verifyCmd": "$TC actions list action pedit",
"matchPattern": "action order [0-9]+: pedit action continue keys 1.*key #0 at 0: val 00000000 mask ff00ffff",
"matchCount": "1",
"teardown": [
"$TC actions flush action pedit"
]
},
{
"id": "6b1b",
"name": "Add pedit action with LAYERED_OP ip clear precedence",
"category": [
"actions",
"pedit",
"layered_op"
],
"setup": [
[
"$TC actions flush action pedit",
0,
1,
255
]
],
"cmdUnderTest": "$TC actions add action pedit munge ip precedence clear jump 2",
"expExitCode": "0",
"verifyCmd": "$TC actions list action pedit",
"matchPattern": "action order [0-9]+: pedit action jump 2 keys 1.*key #0 at 0: val 00000000 mask ff00ffff",
"matchCount": "1",
"teardown": [
"$TC actions flush action pedit"
]
},
{
"id": "824a",
"name": "Add pedit action with LAYERED_OP ip invert tos",
"category": [
"actions",
"pedit",
"layered_op"
],
"setup": [
[
"$TC actions flush action pedit",
0,
1,
255
]
],
"cmdUnderTest": "$TC actions add action pedit munge ip tos invert pipe",
"expExitCode": "0",
"verifyCmd": "$TC actions list action pedit",
"matchPattern": "action order [0-9]+: pedit action pipe keys 1.*key #0 at 0: val 00ff0000 mask ffffffff",
"matchCount": "1",
"teardown": [
"$TC actions flush action pedit"
]
},
{
"id": "106f",
"name": "Add pedit action with LAYERED_OP ip invert precedence",
"category": [
"actions",
"pedit",
"layered_op"
],
"setup": [
[
"$TC actions flush action pedit",
0,
1,
255
]
],
"cmdUnderTest": "$TC actions add action pedit munge ip precedence invert reclassify",
"expExitCode": "0",
"verifyCmd": "$TC actions list action pedit",
"matchPattern": "action order [0-9]+: pedit action reclassify keys 1.*key #0 at 0: val 00ff0000 mask ffffffff",
"matchCount": "1",
"teardown": [
"$TC actions flush action pedit"
]
},
{
"id": "6829",
"name": "Add pedit action with LAYERED_OP beyond ip set dport & sport",