xref: /linux/tools/testing/selftests/tc-testing/tc-tests/actions/mirred.json (revision 9e56ff53b4115875667760445b028357848b4748)
1[
2    {
3        "id": "5124",
4        "name": "Add mirred mirror to egress action",
5        "category": [
6            "actions",
7            "mirred"
8        ],
9        "plugins": {
10           "requires": "nsPlugin"
11        },
12        "setup": [
13            [
14                "$TC actions flush action mirred",
15                0,
16                1,
17                255
18            ]
19        ],
20        "cmdUnderTest": "$TC actions add action mirred egress mirror index 1 dev lo",
21        "expExitCode": "0",
22        "verifyCmd": "$TC actions list action mirred",
23        "matchPattern": "action order [0-9]*: mirred \\(Egress Mirror to device lo\\).*index 1 ref",
24        "matchCount": "1",
25        "teardown": [
26            "$TC actions flush action mirred"
27        ]
28    },
29    {
30        "id": "6fb4",
31        "name": "Add mirred redirect to egress action",
32        "category": [
33            "actions",
34            "mirred"
35        ],
36        "plugins": {
37           "requires": "nsPlugin"
38        },
39        "setup": [
40            [
41                "$TC actions flush action mirred",
42                0,
43                1,
44                255
45            ]
46        ],
47        "cmdUnderTest": "$TC actions add action mirred egress redirect index 2 dev lo action pipe",
48        "expExitCode": "0",
49        "verifyCmd": "$TC actions list action mirred",
50        "matchPattern": "action order [0-9]*: mirred \\(Egress Redirect to device lo\\).*index 2 ref",
51        "matchCount": "1",
52        "teardown": [
53            "$TC actions flush action mirred",
54            "$TC actions flush action gact"
55        ]
56    },
57    {
58        "id": "ba38",
59        "name": "Get mirred actions",
60        "category": [
61            "actions",
62            "mirred"
63        ],
64        "plugins": {
65           "requires": "nsPlugin"
66        },
67        "setup": [
68            [
69                "$TC actions flush action mirred",
70                0,
71                1,
72                255
73            ],
74            "$TC actions add action mirred egress mirror index 1 dev lo",
75            "$TC actions add action mirred egress redirect index 2 dev lo"
76        ],
77        "cmdUnderTest": "$TC actions show action mirred",
78        "expExitCode": "0",
79        "verifyCmd": "$TC actions list action mirred",
80        "matchPattern": "[Mirror|Redirect] to device lo",
81        "matchCount": "2",
82        "teardown": [
83            "$TC actions flush action mirred"
84        ]
85    },
86    {
87        "id": "d7c0",
88        "name": "Add invalid mirred direction",
89        "category": [
90            "actions",
91            "mirred"
92        ],
93        "plugins": {
94           "requires": "nsPlugin"
95        },
96        "setup": [
97            [
98                "$TC actions flush action mirred",
99                0,
100                1,
101                255
102            ]
103        ],
104        "cmdUnderTest": "$TC actions add action mirred inbound mirror index 20 dev lo",
105        "expExitCode": "255",
106        "verifyCmd": "$TC actions list action mirred",
107        "matchPattern": "action order [0-9]*: mirred \\(.*to device lo\\).*index 20 ref",
108        "matchCount": "0",
109        "teardown": [
110            "$TC actions flush action mirred"
111        ]
112    },
113    {
114        "id": "e213",
115        "name": "Add invalid mirred action",
116        "category": [
117            "actions",
118            "mirred"
119        ],
120        "plugins": {
121           "requires": "nsPlugin"
122        },
123        "setup": [
124            [
125                "$TC actions flush action mirred",
126                0,
127                1,
128                255
129            ]
130        ],
131        "cmdUnderTest": "$TC actions add action mirred egress remirror index 20 dev lo",
132        "expExitCode": "255",
133        "verifyCmd": "$TC actions list action mirred",
134        "matchPattern": "action order [0-9]*: mirred \\(Egress.*to device lo\\).*index 20 ref",
135        "matchCount": "0",
136        "teardown": [
137            "$TC actions flush action mirred"
138        ]
139    },
140    {
141        "id": "2d89",
142        "name": "Add mirred action with invalid device",
143        "category": [
144            "actions",
145            "mirred"
146        ],
147        "plugins": {
148           "requires": "nsPlugin"
149        },
150        "setup": [
151            [
152                "$TC actions flush action mirred",
153                0,
154                1,
155                255
156            ]
157        ],
158        "cmdUnderTest": "$TC actions add action mirred egress mirror index 20 dev eltoh",
159        "expExitCode": "255",
160        "verifyCmd": "$TC actions list action mirred",
161        "matchPattern": "action order [0-9]*: mirred \\(.*to device eltoh\\).*index 20 ref",
162        "matchCount": "0",
163        "teardown": [
164            "$TC actions flush action mirred"
165        ]
166    },
167    {
168        "id": "300b",
169        "name": "Add mirred action with duplicate index",
170        "category": [
171            "actions",
172            "mirred"
173        ],
174        "plugins": {
175           "requires": "nsPlugin"
176        },
177        "setup": [
178            [
179                "$TC actions flush action mirred",
180                0,
181                1,
182                255
183            ],
184            "$TC actions add action mirred egress redirect index 15 dev lo"
185        ],
186        "cmdUnderTest": "$TC actions add action mirred egress mirror index 15 dev lo",
187        "expExitCode": "255",
188        "verifyCmd": "$TC actions list action mirred",
189        "matchPattern": "action order [0-9]*: mirred \\(.*to device lo\\).*index 15 ref",
190        "matchCount": "1",
191        "teardown": [
192            "$TC actions flush action mirred"
193        ]
194    },
195    {
196        "id": "8917",
197        "name": "Add mirred mirror action with control pass",
198        "category": [
199            "actions",
200            "mirred"
201        ],
202        "plugins": {
203           "requires": "nsPlugin"
204        },
205        "setup": [
206            [
207                "$TC actions flush action mirred",
208                0,
209                1,
210                255
211            ]
212        ],
213        "cmdUnderTest": "$TC actions add action mirred ingress mirror dev lo pass index 1",
214        "expExitCode": "0",
215        "verifyCmd": "$TC actions get action mirred index 1",
216        "matchPattern": "action order [0-9]*: mirred \\(Ingress Mirror to device lo\\) pass.*index 1 ref",
217        "matchCount": "1",
218        "teardown": [
219            "$TC actions flush action mirred"
220        ]
221    },
222    {
223        "id": "1054",
224        "name": "Add mirred mirror action with control pipe",
225        "category": [
226            "actions",
227            "mirred"
228        ],
229        "plugins": {
230           "requires": "nsPlugin"
231        },
232        "setup": [
233            [
234                "$TC actions flush action mirred",
235                0,
236                1,
237                255
238            ]
239        ],
240        "cmdUnderTest": "$TC actions add action mirred ingress mirror dev lo pipe index 15",
241        "expExitCode": "0",
242        "verifyCmd": "$TC actions get action mirred index 15",
243        "matchPattern": "action order [0-9]*: mirred \\(Ingress Mirror to device lo\\) pipe.*index 15 ref",
244        "matchCount": "1",
245        "teardown": [
246            "$TC actions flush action mirred"
247        ]
248    },
249    {
250        "id": "9887",
251        "name": "Add mirred mirror action with control continue",
252        "category": [
253            "actions",
254            "mirred"
255        ],
256        "plugins": {
257           "requires": "nsPlugin"
258        },
259        "setup": [
260            [
261                "$TC actions flush action mirred",
262                0,
263                1,
264                255
265            ]
266        ],
267        "cmdUnderTest": "$TC actions add action mirred ingress mirror dev lo continue index 15",
268        "expExitCode": "0",
269        "verifyCmd": "$TC actions get action mirred index 15",
270        "matchPattern": "action order [0-9]*: mirred \\(Ingress Mirror to device lo\\) continue.*index 15 ref",
271        "matchCount": "1",
272        "teardown": [
273            "$TC actions flush action mirred"
274        ]
275    },
276    {
277        "id": "e4aa",
278        "name": "Add mirred mirror action with control reclassify",
279        "category": [
280            "actions",
281            "mirred"
282        ],
283        "plugins": {
284           "requires": "nsPlugin"
285        },
286        "setup": [
287            [
288                "$TC actions flush action mirred",
289                0,
290                1,
291                255
292            ]
293        ],
294        "cmdUnderTest": "$TC actions add action mirred ingress mirror dev lo reclassify index 150",
295        "expExitCode": "0",
296        "verifyCmd": "$TC actions get action mirred index 150",
297        "matchPattern": "action order [0-9]*: mirred \\(Ingress Mirror to device lo\\) reclassify.*index 150 ref",
298        "matchCount": "1",
299        "teardown": [
300            "$TC actions flush action mirred"
301        ]
302    },
303    {
304        "id": "ece9",
305        "name": "Add mirred mirror action with control drop",
306        "category": [
307            "actions",
308            "mirred"
309        ],
310        "plugins": {
311           "requires": "nsPlugin"
312        },
313        "setup": [
314            [
315                "$TC actions flush action mirred",
316                0,
317                1,
318                255
319            ]
320        ],
321        "cmdUnderTest": "$TC actions add action mirred ingress mirror dev lo drop index 99",
322        "expExitCode": "0",
323        "verifyCmd": "$TC actions get action mirred index 99",
324        "matchPattern": "action order [0-9]*: mirred \\(Ingress Mirror to device lo\\) drop.*index 99 ref",
325        "matchCount": "1",
326        "teardown": [
327            "$TC actions flush action mirred"
328        ]
329    },
330    {
331        "id": "0031",
332        "name": "Add mirred mirror action with control jump",
333        "category": [
334            "actions",
335            "mirred"
336        ],
337        "plugins": {
338           "requires": "nsPlugin"
339        },
340        "setup": [
341            [
342                "$TC actions flush action mirred",
343                0,
344                1,
345                255
346            ]
347        ],
348        "cmdUnderTest": "$TC actions add action mirred ingress mirror dev lo jump 10 index 99",
349        "expExitCode": "0",
350        "verifyCmd": "$TC actions get action mirred index 99",
351        "matchPattern": "action order [0-9]*: mirred \\(Ingress Mirror to device lo\\) jump 10.*index 99 ref",
352        "matchCount": "1",
353        "teardown": [
354            "$TC actions flush action mirred"
355        ]
356    },
357    {
358        "id": "407c",
359        "name": "Add mirred mirror action with cookie",
360        "category": [
361            "actions",
362            "mirred"
363        ],
364        "plugins": {
365           "requires": "nsPlugin"
366        },
367        "setup": [
368            [
369                "$TC actions flush action mirred",
370                0,
371                1,
372                255
373            ]
374        ],
375        "cmdUnderTest": "$TC actions add action mirred ingress mirror dev lo reclassify cookie aa11bb22cc33dd44ee55",
376        "expExitCode": "0",
377        "verifyCmd": "$TC actions ls action mirred",
378        "matchPattern": "action order [0-9]*: mirred \\(Ingress Mirror to device lo\\) reclassify.*cookie aa11bb22cc33dd44ee55",
379        "matchCount": "1",
380        "teardown": [
381            "$TC actions flush action mirred"
382        ]
383    },
384    {
385        "id": "8b69",
386        "name": "Add mirred mirror action with index at 32-bit maximum",
387        "category": [
388            "actions",
389            "mirred"
390        ],
391        "plugins": {
392           "requires": "nsPlugin"
393        },
394        "setup": [
395            [
396                "$TC actions flush action mirred",
397                0,
398                1,
399                255
400            ]
401        ],
402        "cmdUnderTest": "$TC actions add action mirred ingress mirror dev lo pipe index 4294967295",
403        "expExitCode": "0",
404        "verifyCmd": "$TC actions get action mirred index 4294967295",
405        "matchPattern": "action order [0-9]*: mirred \\(Ingress Mirror to device lo\\) pipe.*index 4294967295",
406        "matchCount": "1",
407        "teardown": [
408            "$TC actions flush action mirred"
409        ]
410    },
411    {
412        "id": "3f66",
413        "name": "Add mirred mirror action with index exceeding 32-bit maximum",
414        "category": [
415            "actions",
416            "mirred"
417        ],
418        "plugins": {
419           "requires": "nsPlugin"
420        },
421        "setup": [
422            [
423                "$TC actions flush action mirred",
424                0,
425                1,
426                255
427            ]
428        ],
429        "cmdUnderTest": "$TC actions add action mirred ingress mirror dev lo pipe index 429496729555",
430        "expExitCode": "255",
431        "verifyCmd": "$TC actions get action mirred index 429496729555",
432        "matchPattern": "action order [0-9]*: mirred \\(Ingress Mirror to device lo\\) pipe.*index 429496729555",
433        "matchCount": "0",
434        "teardown": []
435    },
436    {
437        "id": "a70e",
438        "name": "Delete mirred mirror action",
439        "category": [
440            "actions",
441            "mirred"
442        ],
443        "plugins": {
444           "requires": "nsPlugin"
445        },
446        "setup": [
447            [
448                "$TC actions flush action mirred",
449                0,
450                1,
451                255
452            ],
453            "$TC actions add action mirred egress mirror index 5 dev lo"
454        ],
455        "cmdUnderTest": "$TC actions del action mirred index 5",
456        "expExitCode": "0",
457        "verifyCmd": "$TC actions list action mirred",
458        "matchPattern": "action order [0-9]*: mirred \\(Egress Mirror to device lo\\).*index 5 ref",
459        "matchCount": "0",
460        "teardown": [
461            "$TC actions flush action mirred"
462        ]
463    },
464    {
465        "id": "3fb3",
466        "name": "Delete mirred redirect action",
467        "category": [
468            "actions",
469            "mirred"
470        ],
471        "plugins": {
472           "requires": "nsPlugin"
473        },
474        "setup": [
475            [
476                "$TC actions flush action mirred",
477                0,
478                1,
479                255
480            ],
481            "$TC actions add action mirred egress redirect index 5 dev lo"
482        ],
483        "cmdUnderTest": "$TC actions del action mirred index 5",
484        "expExitCode": "0",
485        "verifyCmd": "$TC actions list action mirred",
486        "matchPattern": "action order [0-9]*: mirred \\(Egress Redirect to device lo\\).*index 5 ref",
487        "matchCount": "0",
488        "teardown": [
489            "$TC actions flush action mirred"
490        ]
491    },
492    {
493        "id": "2a9a",
494        "name": "Replace mirred action with invalid goto chain control",
495        "category": [
496            "actions",
497            "mirred"
498        ],
499        "plugins": {
500           "requires": "nsPlugin"
501        },
502        "setup": [
503            [
504                "$TC actions flush action mirred",
505                0,
506                1,
507                255
508            ],
509            "$TC actions add action mirred ingress mirror dev lo drop index 90"
510        ],
511        "cmdUnderTest": "$TC actions replace action mirred ingress mirror dev lo goto chain 42 index 90 cookie c1a0c1a0",
512        "expExitCode": "255",
513        "verifyCmd": "$TC actions get action mirred index 90",
514        "matchPattern": "action order [0-9]*: mirred \\(Ingress Mirror to device lo\\) drop.*index 90 ref",
515        "matchCount": "1",
516        "teardown": [
517            "$TC actions flush action mirred"
518        ]
519    },
520    {
521        "id": "4749",
522        "name": "Add batch of 32 mirred redirect egress actions with cookie",
523        "category": [
524            "actions",
525            "mirred"
526        ],
527        "plugins": {
528           "requires": "nsPlugin"
529        },
530        "setup": [
531            [
532                "$TC actions flush action mirred",
533                0,
534                1,
535                255
536            ]
537        ],
538        "cmdUnderTest": "bash -c \"for i in \\`seq 1 32\\`; do cmd=\\\"action mirred egress redirect dev lo index \\$i cookie aabbccddeeff112233445566778800a1 \\\"; args=\"\\$args\\$cmd\"; done && $TC actions add \\$args\"",
539        "expExitCode": "0",
540        "verifyCmd": "$TC actions list action mirred",
541        "matchPattern": "^[ \t]+index [0-9]+ ref",
542        "matchCount": "32",
543        "teardown": [
544            "$TC actions flush action mirred"
545        ]
546    },
547    {
548        "id": "5c69",
549        "name": "Delete batch of 32 mirred redirect egress actions",
550        "category": [
551            "actions",
552            "mirred"
553        ],
554        "plugins": {
555           "requires": "nsPlugin"
556        },
557        "setup": [
558            [
559                "$TC actions flush action mirred",
560                0,
561                1,
562                255
563            ],
564            "bash -c \"for i in \\`seq 1 32\\`; do cmd=\\\"action mirred egress redirect dev lo index \\$i \\\"; args=\\\"\\$args\\$cmd\\\"; done && $TC actions add \\$args\""
565        ],
566        "cmdUnderTest": "bash -c \"for i in \\`seq 1 32\\`; do cmd=\\\"action mirred index \\$i \\\"; args=\"\\$args\\$cmd\"; done && $TC actions del \\$args\"",
567        "expExitCode": "0",
568        "verifyCmd": "$TC actions list action mirred",
569        "matchPattern": "^[ \t]+index [0-9]+ ref",
570        "matchCount": "0",
571        "teardown": []
572    },
573    {
574        "id": "d3c0",
575        "name": "Add batch of 32 mirred mirror ingress actions with cookie",
576        "category": [
577            "actions",
578            "mirred"
579        ],
580        "plugins": {
581           "requires": "nsPlugin"
582        },
583        "setup": [
584            [
585                "$TC actions flush action mirred",
586                0,
587                1,
588                255
589            ]
590        ],
591        "cmdUnderTest": "bash -c \"for i in \\`seq 1 32\\`; do cmd=\\\"action mirred ingress mirror dev lo index \\$i cookie aabbccddeeff112233445566778800a1 \\\"; args=\"\\$args\\$cmd\"; done && $TC actions add \\$args\"",
592        "expExitCode": "0",
593        "verifyCmd": "$TC actions list action mirred",
594        "matchPattern": "^[ \t]+index [0-9]+ ref",
595        "matchCount": "32",
596        "teardown": [
597            "$TC actions flush action mirred"
598        ]
599    },
600    {
601        "id": "e684",
602        "name": "Delete batch of 32 mirred mirror ingress actions",
603        "category": [
604            "actions",
605            "mirred"
606        ],
607        "plugins": {
608           "requires": "nsPlugin"
609        },
610        "setup": [
611            [
612                "$TC actions flush action mirred",
613                0,
614                1,
615                255
616            ],
617            "bash -c \"for i in \\`seq 1 32\\`; do cmd=\\\"action mirred ingress mirror dev lo index \\$i \\\"; args=\\\"\\$args\\$cmd\\\"; done && $TC actions add \\$args\""
618        ],
619        "cmdUnderTest": "bash -c \"for i in \\`seq 1 32\\`; do cmd=\\\"action mirred index \\$i \\\"; args=\"\\$args\\$cmd\"; done && $TC actions del \\$args\"",
620        "expExitCode": "0",
621        "verifyCmd": "$TC actions list action mirred",
622        "matchPattern": "^[ \t]+index [0-9]+ ref",
623        "matchCount": "0",
624        "teardown": []
625    },
626    {
627        "id": "31e3",
628        "name": "Add mirred mirror to egress action with no_percpu flag",
629        "category": [
630            "actions",
631            "mirred"
632        ],
633        "plugins": {
634           "requires": "nsPlugin"
635        },
636        "setup": [
637            [
638                "$TC actions flush action mirred",
639                0,
640                1,
641                255
642            ]
643        ],
644        "cmdUnderTest": "$TC actions add action mirred egress mirror dev lo no_percpu",
645        "expExitCode": "0",
646        "verifyCmd": "$TC actions list action mirred",
647        "matchPattern": "action order [0-9]*: mirred \\(Egress Mirror to device lo\\).*no_percpu",
648        "matchCount": "1",
649        "teardown": [
650            "$TC actions flush action mirred"
651        ]
652    }
653]
654