xref: /openbmc/linux/tools/testing/selftests/tc-testing/tc-tests/actions/police.json (revision b240b419db5d624ce7a5a397d6f62a1a686009ec)
1[
2    {
3        "id": "49aa",
4        "name": "Add valid basic police action",
5        "category": [
6            "actions",
7            "police"
8        ],
9        "setup": [
10            [
11                "$TC actions flush action police",
12                0,
13                1,
14                255
15            ]
16        ],
17        "cmdUnderTest": "$TC actions add action police rate 1kbit burst 10k index 1",
18        "expExitCode": "0",
19        "verifyCmd": "$TC actions ls action police",
20        "matchPattern": "action order [0-9]*:  police 0x1 rate 1Kbit burst 10Kb",
21        "matchCount": "1",
22        "teardown": [
23            "$TC actions flush action police"
24        ]
25    },
26    {
27        "id": "3abe",
28        "name": "Add police action with duplicate index",
29        "category": [
30            "actions",
31            "police"
32        ],
33        "setup": [
34            [
35                "$TC actions flush action police",
36                0,
37                1,
38                255
39            ],
40            "$TC actions add action police rate 4Mbit burst 120k index 9"
41        ],
42        "cmdUnderTest": "$TC actions add action police rate 8kbit burst 24k index 9",
43        "expExitCode": "255",
44        "verifyCmd": "$TC actions ls action police",
45        "matchPattern": "action order [0-9]*:  police 0x9",
46        "matchCount": "1",
47        "teardown": [
48            "$TC actions flush action police"
49        ]
50    },
51    {
52        "id": "49fa",
53        "name": "Add valid police action with mtu",
54        "category": [
55            "actions",
56            "police"
57        ],
58        "setup": [
59            [
60                "$TC actions flush action police",
61                0,
62                1,
63                255
64            ]
65        ],
66        "cmdUnderTest": "$TC actions add action police rate 90kbit burst 10k mtu 1k index 98",
67        "expExitCode": "0",
68        "verifyCmd": "$TC actions get action police index 98",
69        "matchPattern": "action order [0-9]*:  police 0x62 rate 90Kbit burst 10Kb mtu 1Kb",
70        "matchCount": "1",
71        "teardown": [
72            "$TC actions flush action police"
73        ]
74    },
75    {
76        "id": "7943",
77        "name": "Add valid police action with peakrate",
78        "category": [
79            "actions",
80            "police"
81        ],
82        "setup": [
83            [
84                "$TC actions flush action police",
85                0,
86                1,
87                255
88            ]
89        ],
90        "cmdUnderTest": "$TC actions add action police rate 90kbit burst 10k mtu 2kb peakrate 100kbit index 3",
91        "expExitCode": "0",
92        "verifyCmd": "$TC actions ls action police",
93        "matchPattern": "action order [0-9]*:  police 0x3 rate 90Kbit burst 10Kb mtu 2Kb peakrate 100Kbit",
94        "matchCount": "1",
95        "teardown": [
96            "$TC actions flush action police"
97        ]
98    },
99    {
100        "id": "055e",
101        "name": "Add police action with peakrate and no mtu",
102        "category": [
103            "actions",
104            "police"
105        ],
106        "setup": [
107            [
108                "$TC actions flush action police",
109                0,
110                1,
111                255
112            ]
113        ],
114        "cmdUnderTest": "$TC actions add action police rate 5kbit burst 6kb peakrate 10kbit index 9",
115        "expExitCode": "255",
116        "verifyCmd": "$TC actions ls action police",
117        "matchPattern": "action order [0-9]*:  police 0x9 rate 5Kb burst 10Kb",
118        "matchCount": "0",
119        "teardown": [
120            "$TC actions flush action police"
121        ]
122    },
123    {
124        "id": "f057",
125        "name": "Add police action with valid overhead",
126        "category": [
127            "actions",
128            "police"
129        ],
130        "setup": [
131            [
132                "$TC actions flush action police",
133                0,
134                1,
135                255
136            ]
137        ],
138        "cmdUnderTest": "$TC actions add action police rate 1mbit burst 100k overhead 64 index 64",
139        "expExitCode": "0",
140        "verifyCmd": "$TC actions get action police index 64",
141        "matchPattern": "action order [0-9]*:  police 0x40 rate 1Mbit burst 100Kb mtu 2Kb action reclassify overhead 64b",
142        "matchCount": "1",
143        "teardown": [
144            "$TC actions flush action police"
145        ]
146    },
147    {
148        "id": "7ffb",
149        "name": "Add police action with ethernet linklayer type",
150        "category": [
151            "actions",
152            "police"
153        ],
154        "setup": [
155            [
156                "$TC actions flush action police",
157                0,
158                1,
159                255
160            ]
161        ],
162        "cmdUnderTest": "$TC actions add action police rate 2mbit burst 200k linklayer ethernet index 8",
163        "expExitCode": "0",
164        "verifyCmd": "$TC actions show action police",
165        "matchPattern": "action order [0-9]*:  police 0x8 rate 2Mbit burst 200Kb mtu 2Kb action reclassify overhead 0b",
166        "matchCount": "1",
167        "teardown": [
168            "$TC actions flush action police"
169        ]
170    },
171    {
172        "id": "3dda",
173        "name": "Add police action with atm linklayer type",
174        "category": [
175            "actions",
176            "police"
177        ],
178        "setup": [
179            [
180                "$TC actions flush action police",
181                0,
182                1,
183                255
184            ]
185        ],
186        "cmdUnderTest": "$TC actions add action police rate 2mbit burst 200k linklayer atm index 8",
187        "expExitCode": "0",
188        "verifyCmd": "$TC actions show action police",
189        "matchPattern": "action order [0-9]*:  police 0x8 rate 2Mbit burst 200Kb mtu 2Kb action reclassify overhead 0b linklayer atm",
190        "matchCount": "1",
191        "teardown": [
192            "$TC actions flush action police"
193        ]
194    },
195    {
196        "id": "551b",
197        "name": "Add police actions with conform-exceed control continue/drop",
198        "category": [
199            "actions",
200            "police"
201        ],
202        "setup": [
203            [
204                "$TC actions flush action police",
205                0,
206                1,
207                255
208            ]
209        ],
210        "cmdUnderTest": "$TC actions add action police rate 3mbit burst 250k conform-exceed continue/drop index 1",
211        "expExitCode": "0",
212        "verifyCmd": "$TC actions get action police index 1",
213        "matchPattern": "action order [0-9]*:  police 0x1 rate 3Mbit burst 250Kb mtu 2Kb action continue/drop",
214        "matchCount": "1",
215        "teardown": [
216            "$TC actions flush action police"
217        ]
218    },
219    {
220        "id": "0c70",
221        "name": "Add police actions with conform-exceed control pass/reclassify",
222        "category": [
223            "actions",
224            "police"
225        ],
226        "setup": [
227            [
228                "$TC actions flush action police",
229                0,
230                1,
231                255
232            ]
233        ],
234        "cmdUnderTest": "$TC actions add action police rate 3mbit burst 250k conform-exceed pass/reclassify index 4",
235        "expExitCode": "0",
236        "verifyCmd": "$TC actions ls action police",
237        "matchPattern": "action order [0-9]*:  police 0x4 rate 3Mbit burst 250Kb mtu 2Kb action pass/reclassify",
238        "matchCount": "1",
239        "teardown": [
240            "$TC actions flush action police"
241        ]
242    },
243    {
244        "id": "d946",
245        "name": "Add police actions with conform-exceed control pass/pipe",
246        "category": [
247            "actions",
248            "police"
249        ],
250        "setup": [
251            [
252                "$TC actions flush action police",
253                0,
254                1,
255                255
256            ]
257        ],
258        "cmdUnderTest": "$TC actions add action police rate 3mbit burst 250k conform-exceed pass/pipe index 5",
259        "expExitCode": "0",
260        "verifyCmd": "$TC actions ls action police",
261        "matchPattern": "action order [0-9]*:  police 0x5 rate 3Mbit burst 250Kb mtu 2Kb action pass/pipe",
262        "matchCount": "1",
263        "teardown": [
264            "$TC actions flush action police"
265        ]
266    },
267    {
268        "id": "ddd6",
269        "name": "Add police action with invalid rate value",
270        "category": [
271            "actions",
272            "police"
273        ],
274        "setup": [
275            [
276                "$TC actions flush action police",
277                0,
278                1,
279                255
280            ]
281        ],
282        "cmdUnderTest": "$TC actions add action police rate 3tb burst 250k conform-exceed pass/pipe index 5",
283        "expExitCode": "255",
284        "verifyCmd": "$TC actions ls action police",
285        "matchPattern": "action order [0-9]*:  police 0x5 rate 3Tb burst 250Kb mtu 2Kb action pass/pipe",
286        "matchCount": "0",
287        "teardown": [
288            "$TC actions flush action police"
289        ]
290    },
291    {
292        "id": "f61c",
293        "name": "Add police action with invalid burst value",
294        "category": [
295            "actions",
296            "police"
297        ],
298        "setup": [
299            [
300                "$TC actions flush action police",
301                0,
302                1,
303                255
304            ]
305        ],
306        "cmdUnderTest": "$TC actions add action police rate 3kbit burst 250P conform-exceed pass/pipe index 5",
307        "expExitCode": "255",
308        "verifyCmd": "$TC actions ls action police",
309        "matchPattern": "action order [0-9]*:  police 0x5 rate 3Kbit burst 250Pb mtu 2Kb action pass/pipe",
310        "matchCount": "0",
311        "teardown": [
312            "$TC actions flush action police"
313        ]
314    },
315    {
316        "id": "c26f",
317        "name": "Add police action with invalid peakrate value",
318        "category": [
319            "actions",
320            "police"
321        ],
322        "setup": [
323            [
324                "$TC actions flush action police",
325                0,
326                1,
327                255
328            ]
329        ],
330        "cmdUnderTest": "$TC actions add action police rate 90kbit burst 10k mtu 2kb peakrate 100T index 1",
331        "expExitCode": "255",
332        "verifyCmd": "$TC actions ls action police",
333        "matchPattern": "action order [0-9]*:  police 0x1 rate 90Kbit burst 10Kb mtu 2Kb peakrate 100Tbit",
334        "matchCount": "0",
335        "teardown": [
336            "$TC actions flush action police"
337        ]
338    },
339    {
340        "id": "db04",
341        "name": "Add police action with invalid mtu value",
342        "category": [
343            "actions",
344            "police"
345        ],
346        "setup": [
347            [
348                "$TC actions flush action police",
349                0,
350                1,
351                255
352            ]
353        ],
354        "cmdUnderTest": "$TC actions add action police rate 10kbit burst 10k mtu 2Pbit index 1",
355        "expExitCode": "255",
356        "verifyCmd": "$TC actions ls action police",
357        "matchPattern": "action order [0-9]*:  police 0x1 rate 10Kbit burst 1Kb mtu 2Pb",
358        "matchCount": "0",
359        "teardown": [
360            "$TC actions flush action police"
361        ]
362    },
363    {
364        "id": "f3c9",
365        "name": "Add police action with cookie",
366        "category": [
367            "actions",
368            "police"
369        ],
370        "setup": [
371            [
372                "$TC actions flush action police",
373                0,
374                1,
375                255
376            ]
377        ],
378        "cmdUnderTest": "$TC actions add action police rate 10mbit burst 10k index 1 cookie a1b1c1d1e1f12233bb",
379        "expExitCode": "0",
380        "verifyCmd": "$TC actions get action police index 1",
381        "matchPattern": "action order [0-9]*:  police 0x1 rate 10Mbit burst 10Kb mtu 2Kb.*cookie a1b1c1d1e1f12233bb",
382        "matchCount": "1",
383        "teardown": [
384            "$TC actions flush action police"
385        ]
386    },
387    {
388        "id": "d190",
389        "name": "Add police action with maximum index",
390        "category": [
391            "actions",
392            "police"
393        ],
394        "setup": [
395            [
396                "$TC actions flush action police",
397                0,
398                1,
399                255
400            ]
401        ],
402        "cmdUnderTest": "$TC actions add action police rate 10mbit burst 10k index 4294967295",
403        "expExitCode": "0",
404        "verifyCmd": "$TC actions get action mirred index 4294967295",
405        "matchPattern": "action order [0-9]*:  police 0xffffffff rate 10Mbit burst 10Kb mtu 2Kb",
406        "matchCount": "1",
407        "teardown": [
408            "$TC actions flush action mirred"
409        ]
410    },
411    {
412        "id": "336e",
413        "name": "Delete police action",
414        "category": [
415            "actions",
416            "police"
417        ],
418        "setup": [
419            [
420                "$TC actions flush action police",
421                0,
422                1,
423                255
424            ],
425            "$TC actions add action police rate 5mbit burst 2m index 12"
426        ],
427        "cmdUnderTest": "$TC actions delete action police index 12",
428        "expExitCode": "0",
429        "verifyCmd": "$TC actions ls action police",
430        "matchPattern": "action order [0-9]*:  police 0xc rate 5Mb burst 2Mb",
431        "matchCount": "0",
432        "teardown": [
433            "$TC actions flush action police"
434        ]
435    },
436    {
437        "id": "77fa",
438        "name": "Get single police action from many actions",
439        "category": [
440            "actions",
441            "police"
442        ],
443        "setup": [
444            [
445                "$TC actions flush action police",
446                0,
447                1,
448                255
449            ],
450            "$TC actions add action police rate 1mbit burst 100k index 1",
451            "$TC actions add action police rate 2mbit burst 200k index 2",
452            "$TC actions add action police rate 3mbit burst 300k index 3",
453            "$TC actions add action police rate 4mbit burst 400k index 4",
454            "$TC actions add action police rate 5mbit burst 500k index 5",
455            "$TC actions add action police rate 6mbit burst 600k index 6",
456            "$TC actions add action police rate 7mbit burst 700k index 7",
457            "$TC actions add action police rate 8mbit burst 800k index 8"
458        ],
459        "cmdUnderTest": "$TC actions get action police index 4",
460        "expExitCode": "0",
461        "verifyCmd": "$TC actions get action police index 4",
462        "matchPattern": "action order [0-9]*:  police 0x4 rate 4Mbit burst 400Kb",
463        "matchCount": "1",
464        "teardown": [
465            "$TC actions flush action police"
466        ]
467    },
468    {
469        "id": "aa43",
470        "name": "Get single police action without specifying index",
471        "category": [
472            "actions",
473            "police"
474        ],
475        "setup": [
476            [
477                "$TC actions flush action police",
478                0,
479                1,
480                255
481            ],
482            "$TC actions add action police rate 1mbit burst 100k index 1"
483        ],
484        "cmdUnderTest": "$TC actions get action police",
485        "expExitCode": "255",
486        "verifyCmd": "$TC actions get action police",
487        "matchPattern": "action order [0-9]*:  police",
488        "matchCount": "0",
489        "teardown": [
490            "$TC actions flush action police"
491        ]
492    },
493    {
494        "id": "858b",
495        "name": "List police actions",
496        "category": [
497            "actions",
498            "police"
499        ],
500        "setup": [
501            [
502                "$TC actions flush action police",
503                0,
504                1,
505                255
506            ],
507            "$TC actions add action police rate 1mbit burst 100k index 1",
508            "$TC actions add action police rate 2mbit burst 200k index 2",
509            "$TC actions add action police rate 3mbit burst 300k index 3",
510            "$TC actions add action police rate 4mbit burst 400k index 4",
511            "$TC actions add action police rate 5mbit burst 500k index 5",
512            "$TC actions add action police rate 6mbit burst 600k index 6",
513            "$TC actions add action police rate 7mbit burst 700k index 7",
514            "$TC actions add action police rate 8mbit burst 800k index 8"
515        ],
516        "cmdUnderTest": "$TC actions list action police",
517        "expExitCode": "0",
518        "verifyCmd": "$TC actions ls action police",
519        "matchPattern": "action order [0-9]*:  police 0x[1-8] rate [1-8]Mbit burst [1-8]00Kb",
520        "matchCount": "8",
521        "teardown": [
522            "$TC actions flush action police"
523        ]
524    },
525    {
526        "id": "1c3a",
527        "name": "Flush police actions",
528        "category": [
529            "actions",
530            "police"
531        ],
532        "setup": [
533            "$TC actions add action police rate 1mbit burst 100k index 1",
534            "$TC actions add action police rate 2mbit burst 200k index 2",
535            "$TC actions add action police rate 3mbit burst 300k index 3",
536            "$TC actions add action police rate 4mbit burst 400k index 4",
537            "$TC actions add action police rate 5mbit burst 500k index 5",
538            "$TC actions add action police rate 6mbit burst 600k index 6",
539            "$TC actions add action police rate 7mbit burst 700k index 7",
540            "$TC actions add action police rate 8mbit burst 800k index 8"
541        ],
542        "cmdUnderTest": "$TC actions flush action police",
543        "expExitCode": "0",
544        "verifyCmd": "$TC actions ls action police",
545        "matchPattern": "action order [0-9]*:  police",
546        "matchCount": "0",
547        "teardown": [
548            ""
549        ]
550    },
551    {
552        "id": "7326",
553        "name": "Add police action with control continue",
554        "category": [
555            "actions",
556            "police"
557        ],
558        "setup": [
559            [
560                "$TC actions flush action police",
561                0,
562                1,
563                255
564            ]
565        ],
566        "cmdUnderTest": "$TC actions add action police rate 7mbit burst 1m continue index 1",
567        "expExitCode": "0",
568        "verifyCmd": "$TC actions get action police index 1",
569        "matchPattern": "action order [0-9]*:  police 0x1 rate 7Mbit burst 1024Kb mtu 2Kb action continue",
570        "matchCount": "1",
571        "teardown": [
572            "$TC actions flush action police"
573        ]
574    },
575    {
576        "id": "34fa",
577        "name": "Add police action with control drop",
578        "category": [
579            "actions",
580            "police"
581        ],
582        "setup": [
583            [
584                "$TC actions flush action police",
585                0,
586                1,
587                255
588            ]
589        ],
590        "cmdUnderTest": "$TC actions add action police rate 7mbit burst 1m drop index 1",
591        "expExitCode": "0",
592        "verifyCmd": "$TC actions ls action police",
593        "matchPattern": "action order [0-9]*:  police 0x1 rate 7Mbit burst 1024Kb mtu 2Kb action drop",
594        "matchCount": "1",
595        "teardown": [
596            "$TC actions flush action police"
597        ]
598    },
599    {
600        "id": "8dd5",
601        "name": "Add police action with control ok",
602        "category": [
603            "actions",
604            "police"
605        ],
606        "setup": [
607            [
608                "$TC actions flush action police",
609                0,
610                1,
611                255
612            ]
613        ],
614        "cmdUnderTest": "$TC actions add action police rate 7mbit burst 1m ok index 1",
615        "expExitCode": "0",
616        "verifyCmd": "$TC actions ls action police",
617        "matchPattern": "action order [0-9]*:  police 0x1 rate 7Mbit burst 1024Kb mtu 2Kb action pass",
618        "matchCount": "1",
619        "teardown": [
620            "$TC actions flush action police"
621        ]
622    },
623    {
624        "id": "b9d1",
625        "name": "Add police action with control reclassify",
626        "category": [
627            "actions",
628            "police"
629        ],
630        "setup": [
631            [
632                "$TC actions flush action police",
633                0,
634                1,
635                255
636            ]
637        ],
638        "cmdUnderTest": "$TC actions add action police rate 7mbit burst 1m reclassify index 1",
639        "expExitCode": "0",
640        "verifyCmd": "$TC actions get action police index 1",
641        "matchPattern": "action order [0-9]*:  police 0x1 rate 7Mbit burst 1024Kb mtu 2Kb action reclassify",
642        "matchCount": "1",
643        "teardown": [
644            "$TC actions flush action police"
645        ]
646    },
647    {
648        "id": "c534",
649        "name": "Add police action with control pipe",
650        "category": [
651            "actions",
652            "police"
653        ],
654        "setup": [
655            [
656                "$TC actions flush action police",
657                0,
658                1,
659                255
660            ]
661        ],
662        "cmdUnderTest": "$TC actions add action police rate 7mbit burst 1m pipe index 1",
663        "expExitCode": "0",
664        "verifyCmd": "$TC actions ls action police",
665        "matchPattern": "action order [0-9]*:  police 0x1 rate 7Mbit burst 1024Kb mtu 2Kb action pipe",
666        "matchCount": "1",
667        "teardown": [
668            "$TC actions flush action police"
669        ]
670    }
671]
672