Re: [PATCH net-next 1/1] tc-testing: updated mirred and vlan with more tests

2018-05-16 Thread David Miller
From: Roman Mashak 
Date: Tue, 15 May 2018 14:31:14 -0400

> Added extra test cases for different control actions (reclassify, pipe
> etc.), cookies, max values & exceeding maximum, and replace existing
> actions unit tests.
> 
> Signed-off-by: Roman Mashak 

Applied, thank you.


[PATCH net-next 1/1] tc-testing: updated mirred and vlan with more tests

2018-05-15 Thread Roman Mashak
Added extra test cases for different control actions (reclassify, pipe
etc.), cookies, max values & exceeding maximum, and replace existing
actions unit tests.

Signed-off-by: Roman Mashak 
---
 .../tc-testing/tc-tests/actions/mirred.json|  24 +-
 .../tc-testing/tc-tests/actions/vlan.json  | 320 +++--
 2 files changed, 324 insertions(+), 20 deletions(-)

diff --git a/tools/testing/selftests/tc-testing/tc-tests/actions/mirred.json 
b/tools/testing/selftests/tc-testing/tc-tests/actions/mirred.json
index 443c9b3c8664..6e4edfae1799 100644
--- a/tools/testing/selftests/tc-testing/tc-tests/actions/mirred.json
+++ b/tools/testing/selftests/tc-testing/tc-tests/actions/mirred.json
@@ -340,7 +340,7 @@
 },
 {
 "id": "8b69",
-"name": "Add mirred mirror action with maximum index",
+"name": "Add mirred mirror action with index at 32-bit maximum",
 "category": [
 "actions",
 "mirred"
@@ -363,6 +363,28 @@
 ]
 },
 {
+"id": "3f66",
+"name": "Add mirred mirror action with index exceeding 32-bit maximum",
+"category": [
+"actions",
+"mirred"
+],
+"setup": [
+[
+"$TC actions flush action mirred",
+0,
+1,
+255
+]
+],
+"cmdUnderTest": "$TC actions add action mirred ingress mirror dev lo 
pipe index 429496729555",
+"expExitCode": "255",
+"verifyCmd": "$TC actions get action mirred index 429496729555",
+"matchPattern": "action order [0-9]*: mirred \\(Ingress Mirror to 
device lo\\) pipe.*index 429496729555",
+"matchCount": "0",
+"teardown": []
+},
+{
 "id": "a70e",
 "name": "Delete mirred mirror action",
 "category": [
diff --git a/tools/testing/selftests/tc-testing/tc-tests/actions/vlan.json 
b/tools/testing/selftests/tc-testing/tc-tests/actions/vlan.json
index 4510ddfa6e54..69ea09eefffc 100644
--- a/tools/testing/selftests/tc-testing/tc-tests/actions/vlan.json
+++ b/tools/testing/selftests/tc-testing/tc-tests/actions/vlan.json
@@ -1,7 +1,7 @@
 [
 {
 "id": "6f5a",
-"name": "Add vlan pop action",
+"name": "Add vlan pop action with pipe opcode",
 "category": [
 "actions",
 "vlan"
@@ -14,18 +14,18 @@
 255
 ]
 ],
-"cmdUnderTest": "$TC actions add action vlan pop index 8",
+"cmdUnderTest": "$TC actions add action vlan pop pipe index 8",
 "expExitCode": "0",
 "verifyCmd": "$TC actions list action vlan",
-"matchPattern": "action order [0-9]+: vlan.*pop.*index 8 ref",
+"matchPattern": "action order [0-9]+: vlan.*pop.*pipe.*index 8 ref",
 "matchCount": "1",
 "teardown": [
 "$TC actions flush action vlan"
 ]
 },
 {
-"id": "ee6f",
-"name": "Add vlan pop action with large index",
+"id": "df35",
+"name": "Add vlan pop action with pass opcode",
 "category": [
 "actions",
 "vlan"
@@ -38,10 +38,82 @@
 255
 ]
 ],
-"cmdUnderTest": "$TC actions add action vlan pop index 4294967295",
+"cmdUnderTest": "$TC actions add action vlan pop pass index 8",
 "expExitCode": "0",
-"verifyCmd": "$TC actions list action vlan",
-"matchPattern": "action order [0-9]+: vlan.*pop.*index 4294967295 ref",
+"verifyCmd": "$TC actions get action vlan index 8",
+"matchPattern": "action order [0-9]+: vlan.*pop.*pass.*index 8 ref",
+"matchCount": "1",
+"teardown": [
+"$TC actions flush action vlan"
+]
+},
+{
+"id": "b0d4",
+"name": "Add vlan pop action with drop opcode",
+"category": [
+"actions",
+"vlan"
+],
+"setup": [
+[
+"$TC actions flush action vlan",
+0,
+1,
+255
+]
+],
+"cmdUnderTest": "$TC actions add action vlan pop drop index 8",
+"expExitCode": "0",
+"verifyCmd": "$TC actions get action vlan index 8",
+"matchPattern": "action order [0-9]+: vlan.*pop.*drop.*index 8 ref",
+"matchCount": "1",
+"teardown": [
+"$TC actions flush action vlan"
+]
+},
+{
+"id": "95ee",
+"name": "Add vlan pop action with reclassify opcode",
+"category": [
+"actions",
+"vlan"
+],
+"setup": [
+[
+"$TC actions flush action vlan",
+0,
+1,
+255
+]
+],
+"cmdUnderTest": "$TC actions add action vlan pop reclassify index 8",
+"expExitCode": "0",
+"verifyCmd": "