xref: /linux/tools/testing/selftests/tc-testing/tc-tests/actions/mirred.json (revision 2f3bfa8e30b5b4864a200be0dc2fb55d8e4b35e4)
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        "id": "456d",
655        "name": "Add mirred mirror to egress block action",
656        "category": [
657            "actions",
658            "mirred"
659        ],
660        "plugins": {
661            "requires": "nsPlugin"
662        },
663        "setup": [
664            [
665                "$TC actions flush action mirred",
666                0,
667                1,
668                255
669            ],
670            [
671                "$TC qdisc add dev $DEV1 egress_block 21 clsact",
672                0
673            ]
674        ],
675        "cmdUnderTest": "$TC actions add action mirred egress mirror index 1 blockid 21",
676        "expExitCode": "0",
677        "verifyCmd": "$TC -j actions get action mirred index 1",
678        "matchJSON": [
679            {
680                "total acts": 0
681            },
682            {
683                "actions": [
684                    {
685                        "order": 1,
686                        "kind": "mirred",
687                        "mirred_action": "mirror",
688                        "direction": "egress",
689                        "to_blockid": 21,
690                        "control_action": {
691                            "type": "pipe"
692                        },
693                        "index": 1,
694                        "ref": 1,
695                        "bind": 0,
696                        "not_in_hw": true
697                    }
698                ]
699            }
700        ],
701        "matchCount": "1",
702        "teardown": [
703            "$TC qdisc del dev $DEV1 egress_block 21 clsact",
704            "$TC actions flush action mirred"
705        ]
706    },
707    {
708        "id": "2358",
709        "name": "Add mirred mirror to ingress block action",
710        "category": [
711            "actions",
712            "mirred"
713        ],
714        "plugins": {
715            "requires": "nsPlugin"
716        },
717        "setup": [
718            [
719                "$TC actions flush action mirred",
720                0,
721                1,
722                255
723            ],
724            [
725                "$TC qdisc add dev $DEV1 ingress_block 21 clsact",
726                0
727            ]
728        ],
729        "cmdUnderTest": "$TC actions add action mirred ingress mirror index 1 blockid 21",
730        "expExitCode": "0",
731        "verifyCmd": "$TC -j actions get action mirred index 1",
732        "matchJSON": [
733            {
734                "total acts": 0
735            },
736            {
737                "actions": [
738                    {
739                        "order": 1,
740                        "kind": "mirred",
741                        "mirred_action": "mirror",
742                        "direction": "ingress",
743                        "to_blockid": 21,
744                        "control_action": {
745                            "type": "pipe"
746                        },
747                        "index": 1,
748                        "ref": 1,
749                        "bind": 0,
750                        "not_in_hw": true
751                    }
752                ]
753            }
754        ],
755        "matchCount": "1",
756        "teardown": [
757            "$TC qdisc del dev $DEV1 ingress_block 21 clsact",
758            "$TC actions flush action mirred"
759        ]
760    },
761    {
762        "id": "fdb1",
763        "name": "Add mirred redirect to egress block action",
764        "category": [
765            "actions",
766            "mirred"
767        ],
768        "plugins": {
769            "requires": "nsPlugin"
770        },
771        "setup": [
772            [
773                "$TC actions flush action mirred",
774                0,
775                1,
776                255
777            ],
778            [
779                "$TC qdisc add dev $DEV1 ingress_block 21 clsact",
780                0
781            ]
782        ],
783        "cmdUnderTest": "$TC actions add action mirred egress redirect index 1 blockid 21",
784        "expExitCode": "0",
785        "verifyCmd": "$TC -j actions get action mirred index 1",
786        "matchJSON": [
787            {
788                "total acts": 0
789            },
790            {
791                "actions": [
792                    {
793                        "order": 1,
794                        "kind": "mirred",
795                        "mirred_action": "redirect",
796                        "direction": "egress",
797                        "to_blockid": 21,
798                        "control_action": {
799                            "type": "stolen"
800                        },
801                        "index": 1,
802                        "ref": 1,
803                        "bind": 0,
804                        "not_in_hw": true
805                    }
806                ]
807            }
808        ],
809        "matchCount": "1",
810        "teardown": [
811            "$TC qdisc del dev $DEV1 ingress_block 21 clsact",
812            "$TC actions flush action mirred"
813        ]
814    },
815    {
816        "id": "20cc",
817        "name": "Add mirred redirect to ingress block action",
818        "category": [
819            "actions",
820            "mirred"
821        ],
822        "plugins": {
823            "requires": "nsPlugin"
824        },
825        "setup": [
826            [
827                "$TC actions flush action mirred",
828                0,
829                1,
830                255
831            ],
832            [
833                "$TC qdisc add dev $DEV1 ingress_block 21 clsact",
834                0
835            ]
836        ],
837        "cmdUnderTest": "$TC actions add action mirred ingress redirect index 1 blockid 21",
838        "expExitCode": "0",
839        "verifyCmd": "$TC -j actions get action mirred index 1",
840        "matchJSON": [
841            {
842                "total acts": 0
843            },
844            {
845                "actions": [
846                    {
847                        "order": 1,
848                        "kind": "mirred",
849                        "mirred_action": "redirect",
850                        "direction": "ingress",
851                        "to_blockid": 21,
852                        "control_action": {
853                            "type": "stolen"
854                        },
855                        "index": 1,
856                        "ref": 1,
857                        "bind": 0,
858                        "not_in_hw": true
859                    }
860                ]
861            }
862        ],
863        "matchCount": "1",
864        "teardown": [
865            "$TC qdisc del dev $DEV1 ingress_block 21 clsact",
866            "$TC actions flush action mirred"
867        ]
868    },
869    {
870        "id": "e739",
871        "name": "Try to add mirred action with both dev and block",
872        "category": [
873            "actions",
874            "mirred"
875        ],
876        "plugins": {
877            "requires": "nsPlugin"
878        },
879        "setup": [
880            [
881                "$TC actions flush action mirred",
882                0,
883                1,
884                255
885            ],
886            [
887                "$TC qdisc add dev $DEV1 ingress_block 21 clsact",
888                0
889            ]
890        ],
891        "cmdUnderTest": "$TC actions add action mirred ingress redirect index 1 blockid 21 dev $DEV1",
892        "expExitCode": "255",
893        "verifyCmd": "$TC -j actions list action mirred",
894        "matchJSON": [],
895        "matchCount": "1",
896        "teardown": [
897            "$TC qdisc del dev $DEV1 ingress_block 21 clsact",
898            "$TC actions flush action mirred"
899        ]
900    },
901    {
902        "id": "2f47",
903        "name": "Try to add mirred action without specifying neither dev nor block",
904        "category": [
905            "actions",
906            "mirred"
907        ],
908        "plugins": {
909            "requires": "nsPlugin"
910        },
911        "setup": [
912            [
913                "$TC actions flush action mirred",
914                0,
915                1,
916                255
917            ],
918            [
919                "$TC qdisc add dev $DEV1 ingress_block 21 clsact",
920                0
921            ]
922        ],
923        "cmdUnderTest": "$TC actions add action mirred ingress redirect index 1",
924        "expExitCode": "255",
925        "verifyCmd": "$TC -j actions list action mirred",
926        "matchJSON": [],
927        "matchCount": "1",
928        "teardown": [
929            "$TC qdisc del dev $DEV1 ingress_block 21 clsact",
930            "$TC actions flush action mirred"
931        ]
932    },
933    {
934        "id": "3188",
935        "name": "Replace mirred redirect to dev action with redirect to block",
936        "category": [
937            "actions",
938            "mirred"
939        ],
940        "plugins": {
941            "requires": "nsPlugin"
942        },
943        "setup": [
944            [
945                "$TC actions flush action mirred",
946                0,
947                1,
948                255
949            ],
950            [
951                "$TC qdisc add dev $DEV1 ingress_block 21 clsact",
952                0
953            ],
954            [
955                "$TC actions add action mirred ingress redirect index 1 dev $DEV1",
956                0
957            ]
958        ],
959        "cmdUnderTest": "$TC actions replace action mirred egress redirect index 1 blockid 21",
960        "expExitCode": "0",
961        "verifyCmd": "$TC -j actions get action mirred index 1",
962        "matchJSON": [
963            {
964                "total acts": 0
965            },
966            {
967                "actions": [
968                    {
969                        "order": 1,
970                        "kind": "mirred",
971                        "mirred_action": "redirect",
972                        "direction": "egress",
973                        "to_blockid": 21,
974                        "control_action": {
975                            "type": "stolen"
976                        },
977                        "index": 1,
978                        "ref": 1,
979                        "bind": 0,
980                        "not_in_hw": true
981                    }
982                ]
983            }
984        ],
985        "matchCount": "1",
986        "teardown": [
987            "$TC qdisc del dev $DEV1 ingress_block 21 clsact",
988            "$TC actions flush action mirred"
989        ]
990    },
991    {
992        "id": "83cc",
993        "name": "Replace mirred redirect to block action with mirror to dev",
994        "category": [
995            "actions",
996            "mirred"
997        ],
998        "plugins": {
999            "requires": "nsPlugin"
1000        },
1001        "setup": [
1002            [
1003                "$TC actions flush action mirred",
1004                0,
1005                1,
1006                255
1007            ],
1008            [
1009                "$TC qdisc add dev $DEV1 ingress_block 21 clsact",
1010                0
1011            ],
1012            [
1013                "$TC actions add action mirred egress redirect index 1 blockid 21",
1014                0
1015            ]
1016        ],
1017        "cmdUnderTest": "$TC actions replace action mirred ingress mirror index 1 dev lo",
1018        "expExitCode": "0",
1019        "verifyCmd": "$TC -j actions get action mirred index 1",
1020        "matchJSON": [
1021            {
1022                "total acts": 0
1023            },
1024            {
1025                "actions": [
1026                    {
1027                        "order": 1,
1028                        "kind": "mirred",
1029                        "mirred_action": "mirror",
1030                        "direction": "ingress",
1031                        "to_dev": "lo",
1032                        "control_action": {
1033                            "type": "pipe"
1034                        },
1035                        "index": 1,
1036                        "ref": 1,
1037                        "bind": 0,
1038                        "not_in_hw": true
1039                    }
1040                ]
1041            }
1042        ],
1043        "matchCount": "1",
1044        "teardown": [
1045            "$TC qdisc del dev $DEV1 ingress_block 21 clsact",
1046            "$TC actions flush action mirred"
1047        ]
1048    }
1049]
1050