hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/tools/testing/selftests/tc-testing/tc-tests/actions/skbedit.json
....@@ -24,8 +24,32 @@
2424 ]
2525 },
2626 {
27
+ "id": "c8cf",
28
+ "name": "Add skbedit action with 32-bit maximum mark",
29
+ "category": [
30
+ "actions",
31
+ "skbedit"
32
+ ],
33
+ "setup": [
34
+ [
35
+ "$TC actions flush action skbedit",
36
+ 0,
37
+ 1,
38
+ 255
39
+ ]
40
+ ],
41
+ "cmdUnderTest": "$TC actions add action skbedit mark 4294967295 pipe index 1",
42
+ "expExitCode": "0",
43
+ "verifyCmd": "$TC actions get action skbedit index 1",
44
+ "matchPattern": "action order [0-9]*: skbedit mark 4294967295.*pipe.*index 1",
45
+ "matchCount": "1",
46
+ "teardown": [
47
+ "$TC actions flush action skbedit"
48
+ ]
49
+ },
50
+ {
2751 "id": "407b",
28
- "name": "Add skbedit action with invalid mark",
52
+ "name": "Add skbedit action with mark exceeding 32-bit maximum",
2953 "category": [
3054 "actions",
3155 "skbedit"
....@@ -43,6 +67,121 @@
4367 "verifyCmd": "$TC actions list action skbedit",
4468 "matchPattern": "action order [0-9]*: skbedit mark",
4569 "matchCount": "0",
70
+ "teardown": []
71
+ },
72
+ {
73
+ "id": "d4cd",
74
+ "name": "Add skbedit action with valid mark and mask",
75
+ "category": [
76
+ "actions",
77
+ "skbedit"
78
+ ],
79
+ "setup": [
80
+ [
81
+ "$TC actions flush action skbedit",
82
+ 0,
83
+ 1,
84
+ 255
85
+ ]
86
+ ],
87
+ "cmdUnderTest": "$TC actions add action skbedit mark 1/0xaabb",
88
+ "expExitCode": "0",
89
+ "verifyCmd": "$TC actions list action skbedit",
90
+ "matchPattern": "action order [0-9]*: skbedit mark 1/0xaabb",
91
+ "matchCount": "1",
92
+ "teardown": [
93
+ "$TC actions flush action skbedit"
94
+ ]
95
+ },
96
+ {
97
+ "id": "baa7",
98
+ "name": "Add skbedit action with valid mark and 32-bit maximum mask",
99
+ "category": [
100
+ "actions",
101
+ "skbedit"
102
+ ],
103
+ "setup": [
104
+ [
105
+ "$TC actions flush action skbedit",
106
+ 0,
107
+ 1,
108
+ 255
109
+ ]
110
+ ],
111
+ "cmdUnderTest": "$TC actions add action skbedit mark 1/0xffffffff",
112
+ "expExitCode": "0",
113
+ "verifyCmd": "$TC actions list action skbedit",
114
+ "matchPattern": "action order [0-9]*: skbedit mark 1/0xffffffff",
115
+ "matchCount": "1",
116
+ "teardown": [
117
+ "$TC actions flush action skbedit"
118
+ ]
119
+ },
120
+ {
121
+ "id": "62a5",
122
+ "name": "Add skbedit action with valid mark and mask exceeding 32-bit maximum",
123
+ "category": [
124
+ "actions",
125
+ "skbedit"
126
+ ],
127
+ "setup": [
128
+ [
129
+ "$TC actions flush action skbedit",
130
+ 0,
131
+ 1,
132
+ 255
133
+ ]
134
+ ],
135
+ "cmdUnderTest": "$TC actions add action skbedit mark 1/0xaabbccddeeff112233",
136
+ "expExitCode": "255",
137
+ "verifyCmd": "$TC actions list action skbedit",
138
+ "matchPattern": "action order [0-9]*: skbedit mark 1/0xaabbccddeeff112233",
139
+ "matchCount": "0",
140
+ "teardown": []
141
+ },
142
+ {
143
+ "id": "bc15",
144
+ "name": "Add skbedit action with valid mark and mask with invalid format",
145
+ "category": [
146
+ "actions",
147
+ "skbedit"
148
+ ],
149
+ "setup": [
150
+ [
151
+ "$TC actions flush action skbedit",
152
+ 0,
153
+ 1,
154
+ 255
155
+ ]
156
+ ],
157
+ "cmdUnderTest": "$TC actions add action skbedit mark 1/-1234",
158
+ "expExitCode": "255",
159
+ "verifyCmd": "$TC actions list action skbedit",
160
+ "matchPattern": "action order [0-9]*: skbedit mark 1/-1234",
161
+ "matchCount": "0",
162
+ "teardown": []
163
+ },
164
+ {
165
+ "id": "57c2",
166
+ "name": "Replace skbedit action with new mask",
167
+ "category": [
168
+ "actions",
169
+ "skbedit"
170
+ ],
171
+ "setup": [
172
+ [
173
+ "$TC actions flush action skbedit",
174
+ 0,
175
+ 1,
176
+ 255
177
+ ],
178
+ "$TC actions add action skbedit mark 1/0x11223344 index 1"
179
+ ],
180
+ "cmdUnderTest": "$TC actions replace action skbedit mark 1/0xaabb index 1",
181
+ "expExitCode": "0",
182
+ "verifyCmd": "$TC actions list action skbedit",
183
+ "matchPattern": "action order [0-9]*: skbedit mark 1/0xaabb",
184
+ "matchCount": "1",
46185 "teardown": [
47186 "$TC actions flush action skbedit"
48187 ]
....@@ -121,7 +260,7 @@
121260 },
122261 {
123262 "id": "985c",
124
- "name": "Add skbedit action with invalid queue_mapping",
263
+ "name": "Add skbedit action with queue_mapping exceeding 16-bit maximum",
125264 "category": [
126265 "actions",
127266 "skbedit"
....@@ -413,7 +552,7 @@
413552 },
414553 {
415554 "id": "a6d6",
416
- "name": "Add skbedit action with index",
555
+ "name": "Add skbedit action with index at 32-bit maximum",
417556 "category": [
418557 "actions",
419558 "skbedit"
....@@ -426,14 +565,36 @@
426565 255
427566 ]
428567 ],
429
- "cmdUnderTest": "$TC actions add action skbedit mark 808 index 4040404040",
568
+ "cmdUnderTest": "$TC actions add action skbedit mark 808 index 4294967295",
430569 "expExitCode": "0",
431
- "verifyCmd": "$TC actions list action skbedit",
432
- "matchPattern": "index 4040404040",
570
+ "verifyCmd": "$TC actions get action skbedit index 4294967295",
571
+ "matchPattern": "action order [0-9]*: skbedit mark 808.*index 4294967295",
433572 "matchCount": "1",
434573 "teardown": [
435574 "$TC actions flush action skbedit"
436575 ]
576
+ },
577
+ {
578
+ "id": "f0f4",
579
+ "name": "Add skbedit action with index exceeding 32-bit maximum",
580
+ "category": [
581
+ "actions",
582
+ "skbedit"
583
+ ],
584
+ "setup": [
585
+ [
586
+ "$TC actions flush action skbedit",
587
+ 0,
588
+ 1,
589
+ 255
590
+ ]
591
+ ],
592
+ "cmdUnderTest": "$TC actions add action skbedit mark 808 pass index 4294967297",
593
+ "expExitCode": "255",
594
+ "verifyCmd": "$TC actions get action skbedit index 4294967297",
595
+ "matchPattern": "action order [0-9]*:.*skbedit.*mark 808.*pass.*index 4294967297",
596
+ "matchCount": "0",
597
+ "teardown": []
437598 },
438599 {
439600 "id": "38f3",
....@@ -484,5 +645,77 @@
484645 "teardown": [
485646 "$TC actions flush action skbedit"
486647 ]
648
+ },
649
+ {
650
+ "id": "1b2b",
651
+ "name": "Replace skbedit action with invalid goto_chain control",
652
+ "category": [
653
+ "actions",
654
+ "skbedit"
655
+ ],
656
+ "setup": [
657
+ [
658
+ "$TC actions flush action skbedit",
659
+ 0,
660
+ 1,
661
+ 255
662
+ ],
663
+ "$TC actions add action skbedit ptype host pass index 90"
664
+ ],
665
+ "cmdUnderTest": "$TC actions replace action skbedit ptype host goto chain 42 index 90 cookie c1a0c1a0",
666
+ "expExitCode": "255",
667
+ "verifyCmd": "$TC actions list action skbedit",
668
+ "matchPattern": "action order [0-9]*: skbedit ptype host pass.*index 90 ref",
669
+ "matchCount": "1",
670
+ "teardown": [
671
+ "$TC actions flush action skbedit"
672
+ ]
673
+ },
674
+ {
675
+ "id": "630c",
676
+ "name": "Add batch of 32 skbedit actions with all parameters and cookie",
677
+ "category": [
678
+ "actions",
679
+ "skbedit"
680
+ ],
681
+ "setup": [
682
+ [
683
+ "$TC actions flush action skbedit",
684
+ 0,
685
+ 1,
686
+ 255
687
+ ]
688
+ ],
689
+ "cmdUnderTest": "bash -c \"for i in \\`seq 1 32\\`; do cmd=\\\"action skbedit queue_mapping 2 priority 10 mark 7/0xaabbccdd ptype host inheritdsfield index \\$i cookie aabbccddeeff112233445566778800a1 \\\"; args=\"\\$args\\$cmd\"; done && $TC actions add \\$args\"",
690
+ "expExitCode": "0",
691
+ "verifyCmd": "$TC actions list action skbedit",
692
+ "matchPattern": "^[ \t]+index [0-9]+ ref",
693
+ "matchCount": "32",
694
+ "teardown": [
695
+ "$TC actions flush action skbedit"
696
+ ]
697
+ },
698
+ {
699
+ "id": "706d",
700
+ "name": "Delete batch of 32 skbedit actions with all parameters",
701
+ "category": [
702
+ "actions",
703
+ "skbedit"
704
+ ],
705
+ "setup": [
706
+ [
707
+ "$TC actions flush action skbedit",
708
+ 0,
709
+ 1,
710
+ 255
711
+ ],
712
+ "bash -c \"for i in \\`seq 1 32\\`; do cmd=\\\"action skbedit queue_mapping 2 priority 10 mark 7/0xaabbccdd ptype host inheritdsfield index \\$i \\\"; args=\\\"\\$args\\$cmd\\\"; done && $TC actions add \\$args\""
713
+ ],
714
+ "cmdUnderTest": "bash -c \"for i in \\`seq 1 32\\`; do cmd=\\\"action skbedit index \\$i \\\"; args=\"\\$args\\$cmd\"; done && $TC actions del \\$args\"",
715
+ "expExitCode": "0",
716
+ "verifyCmd": "$TC actions list action skbedit",
717
+ "matchPattern": "^[ \t]+index [0-9]+ ref",
718
+ "matchCount": "0",
719
+ "teardown": []
487720 }
488721 ]