xref: /linux/tools/testing/selftests/tc-testing/tc-tests/actions/police.json (revision 26fbb4c8c7c3ee9a4c3b4de555a8587b5a19154e)
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": "6aaf",
317        "name": "Add police actions with conform-exceed control pass/pipe [with numeric values]",
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 3mbit burst 250k conform-exceed 0/3 index 1",
331        "expExitCode": "0",
332        "verifyCmd": "$TC actions get action police index 1",
333        "matchPattern": "action order [0-9]*:  police 0x1 rate 3Mbit burst 250Kb mtu 2Kb action pass/pipe",
334        "matchCount": "1",
335        "teardown": [
336            "$TC actions flush action police"
337        ]
338    },
339    {
340        "id": "29b1",
341        "name": "Add police actions with conform-exceed control <invalid>/drop",
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 3mbit burst 250k conform-exceed 10/drop index 1",
355        "expExitCode": "255",
356        "verifyCmd": "$TC actions ls action police",
357        "matchPattern": "action order [0-9]*:  police 0x1 rate 3Mbit burst 250Kb mtu 2Kb action ",
358        "matchCount": "0",
359        "teardown": [
360            "$TC actions flush action police"
361        ]
362    },
363    {
364        "id": "c26f",
365        "name": "Add police action with invalid peakrate value",
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 90kbit burst 10k mtu 2kb peakrate 100T index 1",
379        "expExitCode": "255",
380        "verifyCmd": "$TC actions ls action police",
381        "matchPattern": "action order [0-9]*:  police 0x1 rate 90Kbit burst 10Kb mtu 2Kb peakrate 100Tbit",
382        "matchCount": "0",
383        "teardown": [
384            "$TC actions flush action police"
385        ]
386    },
387    {
388        "id": "db04",
389        "name": "Add police action with invalid mtu value",
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 10kbit burst 10k mtu 2Pbit index 1",
403        "expExitCode": "255",
404        "verifyCmd": "$TC actions ls action police",
405        "matchPattern": "action order [0-9]*:  police 0x1 rate 10Kbit burst 1Kb mtu 2Pb",
406        "matchCount": "0",
407        "teardown": [
408            "$TC actions flush action police"
409        ]
410    },
411    {
412        "id": "f3c9",
413        "name": "Add police action with cookie",
414        "category": [
415            "actions",
416            "police"
417        ],
418        "setup": [
419            [
420                "$TC actions flush action police",
421                0,
422                1,
423                255
424            ]
425        ],
426        "cmdUnderTest": "$TC actions add action police rate 10mbit burst 10k index 1 cookie a1b1c1d1e1f12233bb",
427        "expExitCode": "0",
428        "verifyCmd": "$TC actions get action police index 1",
429        "matchPattern": "action order [0-9]*:  police 0x1 rate 10Mbit burst 10Kb mtu 2Kb.*cookie a1b1c1d1e1f12233bb",
430        "matchCount": "1",
431        "teardown": [
432            "$TC actions flush action police"
433        ]
434    },
435    {
436        "id": "d190",
437        "name": "Add police action with maximum index",
438        "category": [
439            "actions",
440            "police"
441        ],
442        "setup": [
443            [
444                "$TC actions flush action police",
445                0,
446                1,
447                255
448            ]
449        ],
450        "cmdUnderTest": "$TC actions add action police rate 10mbit burst 10k index 4294967295",
451        "expExitCode": "0",
452        "verifyCmd": "$TC actions get action police index 4294967295",
453        "matchPattern": "action order [0-9]*:  police 0xffffffff rate 10Mbit burst 10Kb mtu 2Kb",
454        "matchCount": "1",
455        "teardown": [
456            "$TC actions flush action police"
457        ]
458    },
459    {
460        "id": "336e",
461        "name": "Delete police action",
462        "category": [
463            "actions",
464            "police"
465        ],
466        "setup": [
467            [
468                "$TC actions flush action police",
469                0,
470                1,
471                255
472            ],
473            "$TC actions add action police rate 5mbit burst 2m index 12"
474        ],
475        "cmdUnderTest": "$TC actions delete action police index 12",
476        "expExitCode": "0",
477        "verifyCmd": "$TC actions ls action police",
478        "matchPattern": "action order [0-9]*:  police 0xc rate 5Mb burst 2Mb",
479        "matchCount": "0",
480        "teardown": [
481            "$TC actions flush action police"
482        ]
483    },
484    {
485        "id": "77fa",
486        "name": "Get single police action from many actions",
487        "category": [
488            "actions",
489            "police"
490        ],
491        "setup": [
492            [
493                "$TC actions flush action police",
494                0,
495                1,
496                255
497            ],
498            "$TC actions add action police rate 1mbit burst 100k index 1",
499            "$TC actions add action police rate 2mbit burst 200k index 2",
500            "$TC actions add action police rate 3mbit burst 300k index 3",
501            "$TC actions add action police rate 4mbit burst 400k index 4",
502            "$TC actions add action police rate 5mbit burst 500k index 5",
503            "$TC actions add action police rate 6mbit burst 600k index 6",
504            "$TC actions add action police rate 7mbit burst 700k index 7",
505            "$TC actions add action police rate 8mbit burst 800k index 8"
506        ],
507        "cmdUnderTest": "$TC actions get action police index 4",
508        "expExitCode": "0",
509        "verifyCmd": "$TC actions get action police index 4",
510        "matchPattern": "action order [0-9]*:  police 0x4 rate 4Mbit burst 400Kb",
511        "matchCount": "1",
512        "teardown": [
513            "$TC actions flush action police"
514        ]
515    },
516    {
517        "id": "aa43",
518        "name": "Get single police action without specifying index",
519        "category": [
520            "actions",
521            "police"
522        ],
523        "setup": [
524            [
525                "$TC actions flush action police",
526                0,
527                1,
528                255
529            ],
530            "$TC actions add action police rate 1mbit burst 100k index 1"
531        ],
532        "cmdUnderTest": "$TC actions get action police",
533        "expExitCode": "255",
534        "verifyCmd": "$TC actions get action police",
535        "matchPattern": "action order [0-9]*:  police",
536        "matchCount": "0",
537        "teardown": [
538            "$TC actions flush action police"
539        ]
540    },
541    {
542        "id": "858b",
543        "name": "List police actions",
544        "category": [
545            "actions",
546            "police"
547        ],
548        "setup": [
549            [
550                "$TC actions flush action police",
551                0,
552                1,
553                255
554            ],
555            "$TC actions add action police rate 1mbit burst 100k index 1",
556            "$TC actions add action police rate 2mbit burst 200k index 2",
557            "$TC actions add action police rate 3mbit burst 300k index 3",
558            "$TC actions add action police rate 4mbit burst 400k index 4",
559            "$TC actions add action police rate 5mbit burst 500k index 5",
560            "$TC actions add action police rate 6mbit burst 600k index 6",
561            "$TC actions add action police rate 7mbit burst 700k index 7",
562            "$TC actions add action police rate 8mbit burst 800k index 8"
563        ],
564        "cmdUnderTest": "$TC actions list action police",
565        "expExitCode": "0",
566        "verifyCmd": "$TC actions ls action police",
567        "matchPattern": "action order [0-9]*:  police 0x[1-8] rate [1-8]Mbit burst [1-8]00Kb",
568        "matchCount": "8",
569        "teardown": [
570            "$TC actions flush action police"
571        ]
572    },
573    {
574        "id": "1c3a",
575        "name": "Flush police actions",
576        "category": [
577            "actions",
578            "police"
579        ],
580        "setup": [
581            "$TC actions add action police rate 1mbit burst 100k index 1",
582            "$TC actions add action police rate 2mbit burst 200k index 2",
583            "$TC actions add action police rate 3mbit burst 300k index 3",
584            "$TC actions add action police rate 4mbit burst 400k index 4",
585            "$TC actions add action police rate 5mbit burst 500k index 5",
586            "$TC actions add action police rate 6mbit burst 600k index 6",
587            "$TC actions add action police rate 7mbit burst 700k index 7",
588            "$TC actions add action police rate 8mbit burst 800k index 8"
589        ],
590        "cmdUnderTest": "$TC actions flush action police",
591        "expExitCode": "0",
592        "verifyCmd": "$TC actions ls action police",
593        "matchPattern": "action order [0-9]*:  police",
594        "matchCount": "0",
595        "teardown": [
596            ""
597        ]
598    },
599    {
600        "id": "7326",
601        "name": "Add police action with control continue",
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 continue index 1",
615        "expExitCode": "0",
616        "verifyCmd": "$TC actions get action police index 1",
617        "matchPattern": "action order [0-9]*:  police 0x1 rate 7Mbit burst 1024Kb mtu 2Kb action continue",
618        "matchCount": "1",
619        "teardown": [
620            "$TC actions flush action police"
621        ]
622    },
623    {
624        "id": "34fa",
625        "name": "Add police action with control drop",
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 drop index 1",
639        "expExitCode": "0",
640        "verifyCmd": "$TC actions ls action police",
641        "matchPattern": "action order [0-9]*:  police 0x1 rate 7Mbit burst 1024Kb mtu 2Kb action drop",
642        "matchCount": "1",
643        "teardown": [
644            "$TC actions flush action police"
645        ]
646    },
647    {
648        "id": "8dd5",
649        "name": "Add police action with control ok",
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 ok 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 pass",
666        "matchCount": "1",
667        "teardown": [
668            "$TC actions flush action police"
669        ]
670    },
671    {
672        "id": "b9d1",
673        "name": "Add police action with control reclassify",
674        "category": [
675            "actions",
676            "police"
677        ],
678        "setup": [
679            [
680                "$TC actions flush action police",
681                0,
682                1,
683                255
684            ]
685        ],
686        "cmdUnderTest": "$TC actions add action police rate 7mbit burst 1m reclassify index 1",
687        "expExitCode": "0",
688        "verifyCmd": "$TC actions get action police index 1",
689        "matchPattern": "action order [0-9]*:  police 0x1 rate 7Mbit burst 1024Kb mtu 2Kb action reclassify",
690        "matchCount": "1",
691        "teardown": [
692            "$TC actions flush action police"
693        ]
694    },
695    {
696        "id": "c534",
697        "name": "Add police action with control pipe",
698        "category": [
699            "actions",
700            "police"
701        ],
702        "setup": [
703            [
704                "$TC actions flush action police",
705                0,
706                1,
707                255
708            ]
709        ],
710        "cmdUnderTest": "$TC actions add action police rate 7mbit burst 1m pipe index 1",
711        "expExitCode": "0",
712        "verifyCmd": "$TC actions ls action police",
713        "matchPattern": "action order [0-9]*:  police 0x1 rate 7Mbit burst 1024Kb mtu 2Kb action pipe",
714        "matchCount": "1",
715        "teardown": [
716            "$TC actions flush action police"
717        ]
718    },
719    {
720        "id": "b48b",
721        "name": "Add police action with exceed goto chain control action",
722        "category": [
723            "actions",
724            "police"
725        ],
726        "setup": [
727            [
728                "$TC actions flush action police",
729                0,
730                1,
731                255
732            ]
733        ],
734        "cmdUnderTest": "$TC actions add action police rate 1mbit burst 1k conform-exceed pass / goto chain 42",
735        "expExitCode": "255",
736        "verifyCmd": "$TC actions ls action police",
737        "matchPattern": "action order [0-9]*:  police 0x1 rate 1Mbit burst 1Kb mtu 2Kb action pass/goto chain 42",
738        "matchCount": "0",
739        "teardown": [
740            "$TC actions flush action police"
741        ]
742    },
743    {
744        "id": "689e",
745        "name": "Replace police action with invalid goto chain control",
746        "category": [
747            "actions",
748            "police"
749        ],
750        "setup": [
751            [
752                "$TC actions flush action police",
753                0,
754                1,
755                255
756            ],
757            "$TC actions add action police rate 3mbit burst 250k drop index 90"
758        ],
759        "cmdUnderTest": "$TC actions replace action police rate 3mbit burst 250k goto chain 42 index 90 cookie c1a0c1a0",
760        "expExitCode": "255",
761        "verifyCmd": "$TC actions get action police index 90",
762        "matchPattern": "action order [0-9]*:  police 0x5a rate 3Mbit burst 250Kb mtu 2Kb action drop",
763        "matchCount": "1",
764        "teardown": [
765            "$TC actions flush action police"
766        ]
767    }
768]
769