xref: /linux/tools/testing/selftests/tc-testing/tc-tests/actions/skbedit.json (revision 17cfcb68af3bc7d5e8ae08779b1853310a2949f3)
1[
2    {
3        "id": "6236",
4        "name": "Add skbedit action with valid mark",
5        "category": [
6            "actions",
7            "skbedit"
8        ],
9        "setup": [
10            [
11                "$TC actions flush action skbedit",
12                0,
13                1,
14                255
15            ]
16        ],
17        "cmdUnderTest": "$TC actions add action skbedit mark 1",
18        "expExitCode": "0",
19        "verifyCmd": "$TC actions list action skbedit",
20        "matchPattern": "action order [0-9]*: skbedit  mark 1",
21        "matchCount": "1",
22        "teardown": [
23            "$TC actions flush action skbedit"
24        ]
25    },
26    {
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    {
51        "id": "407b",
52        "name": "Add skbedit action with mark exceeding 32-bit maximum",
53        "category": [
54            "actions",
55            "skbedit"
56        ],
57        "setup": [
58            [
59                "$TC actions flush action skbedit",
60                0,
61                1,
62                255
63            ]
64        ],
65        "cmdUnderTest": "$TC actions add action skbedit mark 666777888999",
66        "expExitCode": "255",
67        "verifyCmd": "$TC actions list action skbedit",
68        "matchPattern": "action order [0-9]*:  skbedit mark",
69        "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",
185        "teardown": [
186            "$TC actions flush action skbedit"
187        ]
188    },
189    {
190        "id": "081d",
191        "name": "Add skbedit action with priority",
192        "category": [
193            "actions",
194            "skbedit"
195        ],
196        "setup": [
197            [
198                "$TC actions flush action skbedit",
199                0,
200                1,
201                255
202            ]
203        ],
204        "cmdUnderTest": "$TC actions add action skbedit prio 99",
205        "expExitCode": "0",
206        "verifyCmd": "$TC actions list action skbedit",
207        "matchPattern": "action order [0-9]*: skbedit  priority :99",
208        "matchCount": "1",
209        "teardown": [
210            "$TC actions flush action skbedit"
211        ]
212    },
213    {
214        "id": "cc37",
215        "name": "Add skbedit action with invalid priority",
216        "category": [
217            "actions",
218            "skbedit"
219        ],
220        "setup": [
221            [
222                "$TC actions flush action skbedit",
223                0,
224                1,
225                255
226            ]
227        ],
228        "cmdUnderTest": "$TC actions add action skbedit prio foo",
229        "expExitCode": "255",
230        "verifyCmd": "$TC actions list action skbedit",
231        "matchPattern": "action order [0-9]*:  skbedit priority",
232        "matchCount": "0",
233        "teardown": [
234            "$TC actions flush action skbedit"
235        ]
236    },
237    {
238        "id": "3c95",
239        "name": "Add skbedit action with queue_mapping",
240        "category": [
241            "actions",
242            "skbedit"
243        ],
244        "setup": [
245            [
246                "$TC actions flush action skbedit",
247                0,
248                1,
249                255
250            ]
251        ],
252        "cmdUnderTest": "$TC actions add action skbedit queue_mapping 909",
253        "expExitCode": "0",
254        "verifyCmd": "$TC actions list action skbedit",
255        "matchPattern": "action order [0-9]*: skbedit queue_mapping 909",
256        "matchCount": "1",
257        "teardown": [
258            "$TC actions flush action skbedit"
259        ]
260    },
261    {
262        "id": "985c",
263        "name": "Add skbedit action with queue_mapping exceeding 16-bit maximum",
264        "category": [
265            "actions",
266            "skbedit"
267        ],
268        "setup": [
269            [
270                "$TC actions flush action skbedit",
271                0,
272                1,
273                255
274            ]
275        ],
276        "cmdUnderTest": "$TC actions add action skbedit queue_mapping 67000",
277        "expExitCode": "255",
278        "verifyCmd": "$TC actions list action skbedit",
279        "matchPattern": "action order [0-9]*:  skbedit queue_mapping",
280        "matchCount": "0",
281        "teardown": [
282            "$TC actions flush action skbedit"
283        ]
284    },
285    {
286        "id": "224f",
287        "name": "Add skbedit action with ptype host",
288        "category": [
289            "actions",
290            "skbedit"
291        ],
292        "setup": [
293            [
294                "$TC actions flush action skbedit",
295                0,
296                1,
297                255
298            ]
299        ],
300        "cmdUnderTest": "$TC actions add action skbedit ptype host",
301        "expExitCode": "0",
302        "verifyCmd": "$TC actions list action skbedit",
303        "matchPattern": "action order [0-9]*: skbedit  ptype host",
304        "matchCount": "1",
305        "teardown": [
306            "$TC actions flush action skbedit"
307        ]
308    },
309    {
310        "id": "d1a3",
311        "name": "Add skbedit action with ptype otherhost",
312        "category": [
313            "actions",
314            "skbedit"
315        ],
316        "setup": [
317            [
318                "$TC actions flush action skbedit",
319                0,
320                1,
321                255
322            ]
323        ],
324        "cmdUnderTest": "$TC actions add action skbedit ptype otherhost",
325        "expExitCode": "0",
326        "verifyCmd": "$TC actions list action skbedit",
327        "matchPattern": "action order [0-9]*: skbedit  ptype otherhost",
328        "matchCount": "1",
329        "teardown": [
330            "$TC actions flush action skbedit"
331        ]
332    },
333    {
334        "id": "b9c6",
335        "name": "Add skbedit action with invalid ptype",
336        "category": [
337            "actions",
338            "skbedit"
339        ],
340        "setup": [
341            [
342                "$TC actions flush action skbedit",
343                0,
344                1,
345                255
346            ]
347        ],
348        "cmdUnderTest": "$TC actions add action skbedit ptype openair",
349        "expExitCode": "255",
350        "verifyCmd": "$TC actions list action skbedit",
351        "matchPattern": "action order [0-9]*:  skbedit ptype openair",
352        "matchCount": "0",
353        "teardown": [
354            "$TC actions flush action skbedit"
355        ]
356    },
357    {
358        "id": "464a",
359        "name": "Add skbedit action with control pipe",
360        "category": [
361            "actions",
362            "skbedit"
363        ],
364        "setup": [
365            [
366                "$TC actions flush action skbedit",
367                0,
368                1,
369                255
370            ]
371        ],
372        "cmdUnderTest": "$TC actions add action skbedit ptype host pipe index 11",
373        "expExitCode": "0",
374        "verifyCmd": "$TC actions get action skbedit index 11",
375        "matchPattern": "action order [0-9]*: skbedit  ptype host pipe.*index 11 ref",
376        "matchCount": "1",
377        "teardown": [
378            "$TC actions flush action skbedit"
379        ]
380    },
381    {
382        "id": "212f",
383        "name": "Add skbedit action with control reclassify",
384        "category": [
385            "actions",
386            "skbedit"
387        ],
388        "setup": [
389            [
390                "$TC actions flush action skbedit",
391                0,
392                1,
393                255
394            ]
395        ],
396        "cmdUnderTest": "$TC actions add action skbedit mark 56789 reclassify index 90",
397        "expExitCode": "0",
398        "verifyCmd": "$TC actions get action skbedit index 90",
399        "matchPattern": "action order [0-9]*: skbedit  mark 56789 reclassify.*index 90 ref",
400        "matchCount": "1",
401        "teardown": [
402            "$TC actions flush action skbedit"
403        ]
404    },
405    {
406        "id": "0651",
407        "name": "Add skbedit action with control pass",
408        "category": [
409            "actions",
410            "skbedit"
411        ],
412        "setup": [
413            [
414                "$TC actions flush action skbedit",
415                0,
416                1,
417                255
418            ]
419        ],
420        "cmdUnderTest": "$TC actions add action skbedit queue_mapping 3 pass index 271",
421        "expExitCode": "0",
422        "verifyCmd": "$TC actions get action skbedit index 271",
423        "matchPattern": "action order [0-9]*: skbedit queue_mapping 3 pass.*index 271 ref",
424        "matchCount": "1",
425        "teardown": [
426            "$TC actions flush action skbedit"
427        ]
428    },
429    {
430        "id": "cc53",
431        "name": "Add skbedit action with control drop",
432        "category": [
433            "actions",
434            "skbedit"
435        ],
436        "setup": [
437            [
438                "$TC actions flush action skbedit",
439                0,
440                1,
441                255
442            ]
443        ],
444        "cmdUnderTest": "$TC actions add action skbedit queue_mapping 3 drop index 271",
445        "expExitCode": "0",
446        "verifyCmd": "$TC actions get action skbedit index 271",
447        "matchPattern": "action order [0-9]*: skbedit queue_mapping 3 drop.*index 271 ref",
448        "matchCount": "1",
449        "teardown": [
450            "$TC actions flush action skbedit"
451        ]
452    },
453    {
454        "id": "ec16",
455        "name": "Add skbedit action with control jump",
456        "category": [
457            "actions",
458            "skbedit"
459        ],
460        "setup": [
461            [
462                "$TC actions flush action skbedit",
463                0,
464                1,
465                255
466            ]
467        ],
468        "cmdUnderTest": "$TC actions add action skbedit priority 8 jump 9 index 2",
469        "expExitCode": "0",
470        "verifyCmd": "$TC actions get action skbedit index 2",
471        "matchPattern": "action order [0-9]*: skbedit  priority :8 jump 9.*index 2 ref",
472        "matchCount": "1",
473        "teardown": [
474            "$TC actions flush action skbedit"
475        ]
476    },
477    {
478        "id": "db54",
479        "name": "Add skbedit action with control continue",
480        "category": [
481            "actions",
482            "skbedit"
483        ],
484        "setup": [
485            [
486                "$TC actions flush action skbedit",
487                0,
488                1,
489                255
490            ]
491        ],
492        "cmdUnderTest": "$TC actions add action skbedit priority 16 continue index 32",
493        "expExitCode": "0",
494        "verifyCmd": "$TC actions get action skbedit index 32",
495        "matchPattern": "action order [0-9]*: skbedit  priority :16 continue.*index 32 ref",
496        "matchCount": "1",
497        "teardown": [
498            "$TC actions flush action skbedit"
499        ]
500    },
501    {
502        "id": "1055",
503        "name": "Add skbedit action with cookie",
504        "category": [
505            "actions",
506            "skbedit"
507        ],
508        "setup": [
509            [
510                "$TC actions flush action skbedit",
511                0,
512                1,
513                255
514            ]
515        ],
516        "cmdUnderTest": "$TC actions add action skbedit priority 16 continue index 32 cookie deadbeef",
517        "expExitCode": "0",
518        "verifyCmd": "$TC actions get action skbedit index 32",
519        "matchPattern": "action order [0-9]*: skbedit  priority :16 continue.*index 32 ref.*cookie deadbeef",
520        "matchCount": "1",
521        "teardown": [
522            "$TC actions flush action skbedit"
523        ]
524    },
525    {
526        "id": "5172",
527        "name": "List skbedit actions",
528        "category": [
529            "actions",
530            "skbedit"
531        ],
532        "setup": [
533            [
534                "$TC actions flush action skbedit",
535                0,
536                1,
537                255
538            ],
539            "$TC actions add action skbedit ptype otherhost",
540            "$TC actions add action skbedit ptype broadcast",
541            "$TC actions add action skbedit mark 59",
542            "$TC actions add action skbedit mark 409"
543        ],
544        "cmdUnderTest": "$TC actions list action skbedit",
545        "expExitCode": "0",
546        "verifyCmd": "$TC actions list action skbedit",
547        "matchPattern": "action order [0-9]*: skbedit",
548        "matchCount": "4",
549        "teardown": [
550            "$TC actions flush action skbedit"
551        ]
552    },
553    {
554        "id": "a6d6",
555        "name": "Add skbedit action with index at 32-bit maximum",
556        "category": [
557            "actions",
558            "skbedit"
559        ],
560        "setup": [
561            [
562                "$TC actions flush action skbedit",
563                0,
564                1,
565                255
566            ]
567        ],
568        "cmdUnderTest": "$TC actions add action skbedit mark 808 index 4294967295",
569        "expExitCode": "0",
570        "verifyCmd": "$TC actions get action skbedit index 4294967295",
571        "matchPattern": "action order [0-9]*: skbedit  mark 808.*index 4294967295",
572        "matchCount": "1",
573        "teardown": [
574            "$TC actions flush action skbedit"
575        ]
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": []
598    },
599    {
600        "id": "38f3",
601        "name": "Delete skbedit action",
602        "category": [
603            "actions",
604            "skbedit"
605        ],
606        "setup": [
607            [
608                "$TC actions flush action skbedit",
609                0,
610                1,
611                255
612            ],
613            "$TC actions add action skbedit mark 42 index 9009"
614        ],
615        "cmdUnderTest": "$TC actions del action skbedit index 9009",
616        "expExitCode": "0",
617        "verifyCmd": "$TC actions list action skbedit",
618        "matchPattern": "action order [0-9]*:  skbedit mark 42",
619        "matchCount": "0",
620        "teardown": [
621            "$TC actions flush action skbedit"
622        ]
623    },
624    {
625        "id": "ce97",
626        "name": "Flush skbedit actions",
627        "category": [
628            "actions",
629            "skbedit"
630        ],
631        "setup": [
632            "$TC actions add action skbedit mark 500",
633            "$TC actions add action skbedit mark 501",
634            "$TC actions add action skbedit mark 502",
635            "$TC actions add action skbedit mark 503",
636            "$TC actions add action skbedit mark 504",
637            "$TC actions add action skbedit mark 505",
638            "$TC actions add action skbedit mark 506"
639        ],
640        "cmdUnderTest": "$TC actions flush action skbedit",
641        "expExitCode": "0",
642        "verifyCmd": "$TC actions list action skbedit",
643        "matchPattern": "action order [0-9]*:  skbedit",
644        "matchCount": "0",
645        "teardown": [
646            "$TC actions flush action skbedit"
647        ]
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": []
720    }
721]
722