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