aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/tc-testing
diff options
context:
space:
mode:
authorKeara Leibovitz <kleib@mojatatu.com>2018-07-17 12:12:54 -0400
committerDavid S. Miller <davem@davemloft.net>2018-07-18 18:20:37 -0400
commit088cbac6bea4d383b9e01f042b50fe00898714f5 (patch)
treef314f8f7788c3973ecc4f5efb988cc7f26cfda13 /tools/testing/selftests/tc-testing
parent0015b80abccecca82622d9e9d48eb210572a0c3b (diff)
tc-tests: initial version of fw filter unit tests
Create initial unit tests for the tc fw filter. Signed-off-by: Keara Leibovitz <kleib@mojatatu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools/testing/selftests/tc-testing')
-rw-r--r--tools/testing/selftests/tc-testing/tc-tests/filters/fw.json1049
1 files changed, 1049 insertions, 0 deletions
diff --git a/tools/testing/selftests/tc-testing/tc-tests/filters/fw.json b/tools/testing/selftests/tc-testing/tc-tests/filters/fw.json
new file mode 100644
index 000000000000..3b97cfd7e0f8
--- /dev/null
+++ b/tools/testing/selftests/tc-testing/tc-tests/filters/fw.json
@@ -0,0 +1,1049 @@
1[
2 {
3 "id": "901f",
4 "name": "Add fw filter with prio at 32-bit maxixum",
5 "category": [
6 "filter",
7 "fw"
8 ],
9 "setup": [
10 "$TC qdisc add dev $DEV1 ingress"
11 ],
12 "cmdUnderTest": "$TC filter add dev $DEV1 parent ffff: handle 1 prio 65535 fw action ok",
13 "expExitCode": "0",
14 "verifyCmd": "$TC filter get dev $DEV1 parent ffff: handle 1 prio 65535 protocol all fw",
15 "matchPattern": "pref 65535 fw.*handle 0x1.*gact action pass",
16 "matchCount": "1",
17 "teardown": [
18 "$TC qdisc del dev $DEV1 ingress"
19 ]
20 },
21 {
22 "id": "51e2",
23 "name": "Add fw filter with prio exceeding 32-bit maxixum",
24 "category": [
25 "filter",
26 "fw"
27 ],
28 "setup": [
29 "$TC qdisc add dev $DEV1 ingress"
30 ],
31 "cmdUnderTest": "$TC filter add dev $DEV1 parent ffff: handle 1 prio 65536 fw action ok",
32 "expExitCode": "255",
33 "verifyCmd": "$TC filter get dev $DEV1 parent ffff: handle 1 prio 65536 protocol all fw",
34 "matchPattern": "pref 65536 fw.*handle 0x1.*gact action pass",
35 "matchCount": "0",
36 "teardown": [
37 "$TC qdisc del dev $DEV1 ingress"
38 ]
39 },
40 {
41 "id": "d987",
42 "name": "Add fw filter with action ok",
43 "category": [
44 "filter",
45 "fw"
46 ],
47 "setup": [
48 "$TC qdisc add dev $DEV1 ingress"
49 ],
50 "cmdUnderTest": "$TC filter add dev $DEV1 parent ffff: handle 1 prio 1 fw action ok",
51 "expExitCode": "0",
52 "verifyCmd": "$TC filter get dev $DEV1 parent ffff: handle 1 prio 1 protocol all fw",
53 "matchPattern": "handle 0x1.*gact action pass",
54 "matchCount": "1",
55 "teardown": [
56 "$TC qdisc del dev $DEV1 ingress"
57 ]
58 },
59 {
60 "id": "affe",
61 "name": "Add fw filter with action continue",
62 "category": [
63 "filter",
64 "fw"
65 ],
66 "setup": [
67 "$TC qdisc add dev $DEV1 ingress"
68 ],
69 "cmdUnderTest": "$TC filter add dev $DEV1 parent ffff: handle 1 prio 1 fw action continue",
70 "expExitCode": "0",
71 "verifyCmd": "$TC filter get dev $DEV1 parent ffff: handle 1 prio 1 protocol all fw",
72 "matchPattern": "handle 0x1.*gact action continue",
73 "matchCount": "1",
74 "teardown": [
75 "$TC qdisc del dev $DEV1 ingress"
76 ]
77 },
78 {
79 "id": "28bc",
80 "name": "Add fw filter with action pipe",
81 "category": [
82 "filter",
83 "fw"
84 ],
85 "setup": [
86 "$TC qdisc add dev $DEV1 ingress"
87 ],
88 "cmdUnderTest": "$TC filter add dev $DEV1 parent ffff: handle 1 prio 1 fw action pipe",
89 "expExitCode": "0",
90 "verifyCmd": "$TC filter get dev $DEV1 parent ffff: handle 1 prio 1 protocol all fw",
91 "matchPattern": "handle 0x1.*gact action pipe",
92 "matchCount": "1",
93 "teardown": [
94 "$TC qdisc del dev $DEV1 ingress"
95 ]
96 },
97 {
98 "id": "8da2",
99 "name": "Add fw filter with action drop",
100 "category": [
101 "filter",
102 "fw"
103 ],
104 "setup": [
105 "$TC qdisc add dev $DEV1 ingress"
106 ],
107 "cmdUnderTest": "$TC filter add dev $DEV1 parent ffff: handle 1 prio 1 fw action drop",
108 "expExitCode": "0",
109 "verifyCmd": "$TC filter get dev $DEV1 parent ffff: handle 1 protocol all prio 1 fw",
110 "matchPattern": "handle 0x1.*gact action drop",
111 "matchCount": "1",
112 "teardown": [
113 "$TC qdisc del dev $DEV1 ingress"
114 ]
115 },
116 {
117 "id": "9436",
118 "name": "Add fw filter with action reclassify",
119 "category": [
120 "filter",
121 "fw"
122 ],
123 "setup": [
124 "$TC qdisc add dev $DEV1 ingress"
125 ],
126 "cmdUnderTest": "$TC filter add dev $DEV1 parent ffff: handle 1 prio 1 fw action reclassify",
127 "expExitCode": "0",
128 "verifyCmd": "$TC filter get dev $DEV1 parent ffff: handle 1 prio 1 protocol all fw",
129 "matchPattern": "handle 0x1.*gact action reclassify",
130 "matchCount": "1",
131 "teardown": [
132 "$TC qdisc del dev $DEV1 ingress"
133 ]
134 },
135 {
136 "id": "95bb",
137 "name": "Add fw filter with action jump 10",
138 "category": [
139 "filter",
140 "fw"
141 ],
142 "setup": [
143 "$TC qdisc add dev $DEV1 ingress"
144 ],
145 "cmdUnderTest": "$TC filter add dev $DEV1 parent ffff: handle 1 prio 1 fw action jump 10",
146 "expExitCode": "0",
147 "verifyCmd": "$TC filter get dev $DEV1 parent ffff: handle 1 prio 1 protocol all fw",
148 "matchPattern": "handle 0x1.*gact action jump 10",
149 "matchCount": "1",
150 "teardown": [
151 "$TC qdisc del dev $DEV1 ingress"
152 ]
153 },
154 {
155 "id": "3d74",
156 "name": "Add fw filter with action goto chain 5",
157 "category": [
158 "filter",
159 "fw"
160 ],
161 "setup": [
162 "$TC qdisc add dev $DEV1 ingress"
163 ],
164 "cmdUnderTest": "$TC filter add dev $DEV1 parent ffff: handle 1 prio 1 fw action goto chain 5",
165 "expExitCode": "0",
166 "verifyCmd": "$TC filter get dev $DEV1 parent ffff: handle 1 prio 1 protocol all fw",
167 "matchPattern": "handle 0x1.*gact action goto chain 5",
168 "matchCount": "1",
169 "teardown": [
170 "$TC qdisc del dev $DEV1 ingress"
171 ]
172 },
173 {
174 "id": "eb8f",
175 "name": "Add fw filter with invalid action",
176 "category": [
177 "filter",
178 "fw"
179 ],
180 "setup": [
181 "$TC qdisc add dev $DEV1 ingress"
182 ],
183 "cmdUnderTest": "$TC filter add dev $DEV1 parent ffff: handle 1 prio 1 fw action pump",
184 "expExitCode": "255",
185 "verifyCmd": "$TC filter get dev $DEV1 parent ffff: handle 1 prio 1 protocol all fw",
186 "matchPattern": "handle 0x1.*gact action pump",
187 "matchCount": "0",
188 "teardown": [
189 "$TC qdisc del dev $DEV1 ingress"
190 ]
191 },
192 {
193 "id": "6a79",
194 "name": "Add fw filter with missing mandatory action",
195 "category": [
196 "filter",
197 "fw"
198 ],
199 "setup": [
200 "$TC qdisc add dev $DEV1 ingress"
201 ],
202 "cmdUnderTest": "$TC filter add dev $DEV1 parent ffff: handle 1 prio 1 fw",
203 "expExitCode": "2",
204 "verifyCmd": "$TC filter get dev $DEV1 parent ffff: handle 1 prio 1 protocol all fw",
205 "matchPattern": "filter protocol all pref [0-9]+ fw.*handle 0x1",
206 "matchCount": "0",
207 "teardown": [
208 "$TC qdisc del dev $DEV1 ingress"
209 ]
210 },
211 {
212 "id": "8298",
213 "name": "Add fw filter with cookie",
214 "category": [
215 "filter",
216 "fw"
217 ],
218 "setup": [
219 "$TC qdisc add dev $DEV1 ingress"
220 ],
221 "cmdUnderTest": "$TC filter add dev $DEV1 parent ffff: handle 1 prio 2 fw action pipe cookie aa11bb22cc33dd44ee55ff66aa11b1b2",
222 "expExitCode": "0",
223 "verifyCmd": "$TC filter get dev $DEV1 parent ffff: handle 1 prio 2 protocol all fw",
224 "matchPattern": "pref 2 fw.*handle 0x1.*gact action pipe.*cookie aa11bb22cc33dd44ee55ff66aa11b1b2",
225 "matchCount": "1",
226 "teardown": [
227 "$TC qdisc del dev $DEV1 ingress"
228 ]
229 },
230 {
231 "id": "a88c",
232 "name": "Add fw filter with invalid cookie",
233 "category": [
234 "filter",
235 "fw"
236 ],
237 "setup": [
238 "$TC qdisc add dev $DEV1 ingress"
239 ],
240 "cmdUnderTest": "$TC filter add dev $DEV1 parent ffff: handle 1 prio 2 fw action continue cookie aa11bb22cc33dd44ee55ff66aa11b1b2777888",
241 "expExitCode": "255",
242 "verifyCmd": "$TC filter get dev $DEV1 parent ffff: handle 1 prio 2 protocol all fw",
243 "matchPattern": "pref 2 fw.*handle 0x1.*gact action continue.*cookie aa11bb22cc33dd44ee55ff66aa11b1b2777888",
244 "matchCount": "0",
245 "teardown": [
246 "$TC qdisc del dev $DEV1 ingress"
247 ]
248 },
249 {
250 "id": "10f6",
251 "name": "Add fw filter with handle in hex",
252 "category": [
253 "filter",
254 "fw"
255 ],
256 "setup": [
257 "$TC qdisc add dev $DEV1 ingress"
258 ],
259 "cmdUnderTest": "$TC filter add dev $DEV1 parent ffff: handle 0xa1b2ff prio 1 fw action ok",
260 "expExitCode": "0",
261 "verifyCmd": "$TC filter get dev $DEV1 parent ffff: handle 0xa1b2ff prio 1 protocol all fw",
262 "matchPattern": "fw.*handle 0xa1b2ff.*gact action pass",
263 "matchCount": "1",
264 "teardown": [
265 "$TC qdisc del dev $DEV1 ingress"
266 ]
267 },
268 {
269 "id": "9d51",
270 "name": "Add fw filter with handle at 32-bit maximum",
271 "category": [
272 "filter",
273 "fw"
274 ],
275 "setup": [
276 "$TC qdisc add dev $DEV1 ingress"
277 ],
278 "cmdUnderTest": "$TC filter add dev $DEV1 parent ffff: handle 4294967295 prio 1 fw action ok",
279 "expExitCode": "0",
280 "verifyCmd": "$TC filter get dev $DEV1 parent ffff: handle 4294967295 prio 1 protocol all fw",
281 "matchPattern": "fw.*handle 0xffffffff.*gact action pass",
282 "matchCount": "1",
283 "teardown": [
284 "$TC qdisc del dev $DEV1 ingress"
285 ]
286 },
287 {
288 "id": "d939",
289 "name": "Add fw filter with handle exceeding 32-bit maximum",
290 "category": [
291 "filter",
292 "fw"
293 ],
294 "setup": [
295 "$TC qdisc add dev $DEV1 ingress"
296 ],
297 "cmdUnderTest": "$TC filter add dev $DEV1 parent ffff: handle 4294967296 prio 1 fw action ok",
298 "expExitCode": "1",
299 "verifyCmd": "$TC filter get dev $DEV1 parent ffff: handle 4294967296 prio 1 protocol all fw",
300 "matchPattern": "fw.*handle 0x.*gact action pass",
301 "matchCount": "0",
302 "teardown": [
303 "$TC qdisc del dev $DEV1 ingress"
304 ]
305 },
306 {
307 "id": "658c",
308 "name": "Add fw filter with mask in hex",
309 "category": [
310 "filter",
311 "fw"
312 ],
313 "setup": [
314 "$TC qdisc add dev $DEV1 ingress"
315 ],
316 "cmdUnderTest": "$TC filter add dev $DEV1 parent ffff: handle 10/0xa1b2f prio 1 fw action ok",
317 "expExitCode": "0",
318 "verifyCmd": "$TC filter get dev $DEV1 parent ffff: handle 10 prio 1 protocol all fw",
319 "matchPattern": "fw.*handle 0xa/0xa1b2f",
320 "matchCount": "1",
321 "teardown": [
322 "$TC qdisc del dev $DEV1 ingress"
323 ]
324 },
325 {
326 "id": "86be",
327 "name": "Add fw filter with mask at 32-bit maximum",
328 "category": [
329 "filter",
330 "fw"
331 ],
332 "setup": [
333 "$TC qdisc add dev $DEV1 ingress"
334 ],
335 "cmdUnderTest": "$TC filter add dev $DEV1 parent ffff: handle 10/4294967295 prio 1 fw action ok",
336 "expExitCode": "0",
337 "verifyCmd": "$TC filter get dev $DEV1 parent ffff: handle 10 prio 1 protocol all fw",
338 "matchPattern": "fw.*handle 0xa[^/]",
339 "matchCount": "1",
340 "teardown": [
341 "$TC qdisc del dev $DEV1 ingress"
342 ]
343 },
344 {
345 "id": "e635",
346 "name": "Add fw filter with mask exceeding 32-bit maximum",
347 "category": [
348 "filter",
349 "fw"
350 ],
351 "setup": [
352 "$TC qdisc add dev $DEV1 ingress"
353 ],
354 "cmdUnderTest": "$TC filter add dev $DEV1 parent ffff: handle 10/4294967296 prio 1 fw action ok",
355 "expExitCode": "1",
356 "verifyCmd": "$TC filter get dev $DEV1 parent ffff: handle 10 prio 1 protocol all fw",
357 "matchPattern": "fw.*handle 0xa",
358 "matchCount": "0",
359 "teardown": [
360 "$TC qdisc del dev $DEV1 ingress"
361 ]
362 },
363 {
364 "id": "6cab",
365 "name": "Add fw filter with handle/mask in hex",
366 "category": [
367 "filter",
368 "fw"
369 ],
370 "setup": [
371 "$TC qdisc add dev $DEV1 ingress"
372 ],
373 "cmdUnderTest": "$TC filter add dev $DEV1 parent ffff: handle 0xa1b2cdff/0x1a2bffdc prio 1 fw action ok",
374 "expExitCode": "0",
375 "verifyCmd": "$TC filter get dev $DEV1 parent ffff: handle 0xa1b2cdff prio 1 protocol all fw",
376 "matchPattern": "fw.*handle 0xa1b2cdff/0x1a2bffdc",
377 "matchCount": "1",
378 "teardown": [
379 "$TC qdisc del dev $DEV1 ingress"
380 ]
381 },
382 {
383 "id": "8700",
384 "name": "Add fw filter with handle/mask at 32-bit maximum",
385 "category": [
386 "filter",
387 "fw"
388 ],
389 "setup": [
390 "$TC qdisc add dev $DEV1 ingress"
391 ],
392 "cmdUnderTest": "$TC filter add dev $DEV1 parent ffff: handle 4294967295/4294967295 prio 1 fw action ok",
393 "expExitCode": "0",
394 "verifyCmd": "$TC filter get dev $DEV1 parent ffff: handle 0xffffffff prio 1 protocol all fw",
395 "matchPattern": "fw.*handle 0xffffffff[^/]",
396 "matchCount": "1",
397 "teardown": [
398 "$TC qdisc del dev $DEV1 ingress"
399 ]
400 },
401 {
402 "id": "7d62",
403 "name": "Add fw filter with handle/mask exceeding 32-bit maximum",
404 "category": [
405 "filter",
406 "fw"
407 ],
408 "setup": [
409 "$TC qdisc add dev $DEV1 ingress"
410 ],
411 "cmdUnderTest": "$TC filter add dev $DEV1 parent ffff: handle 4294967296/4294967296 prio 1 fw action ok",
412 "expExitCode": "1",
413 "verifyCmd": "$TC filter get dev $DEV1 parent ffff: handle 10 prio 1 protocol all fw",
414 "matchPattern": "fw.*handle",
415 "matchCount": "0",
416 "teardown": [
417 "$TC qdisc del dev $DEV1 ingress"
418 ]
419 },
420 {
421 "id": "7b69",
422 "name": "Add fw filter with missing mandatory handle",
423 "category": [
424 "filter",
425 "fw"
426 ],
427 "setup": [
428 "$TC qdisc add dev $DEV1 ingress"
429 ],
430 "cmdUnderTest": "$TC filter add dev $DEV1 parent ffff: prio 1 fw action ok",
431 "expExitCode": "2",
432 "verifyCmd": "$TC filter show dev $DEV1 parent ffff:",
433 "matchPattern": "filter protocol all.*fw.*handle.*gact action pass",
434 "matchCount": "0",
435 "teardown": [
436 "$TC qdisc del dev $DEV1 ingress"
437 ]
438 },
439 {
440 "id": "d68b",
441 "name": "Add fw filter with invalid parent",
442 "category": [
443 "filter",
444 "fw"
445 ],
446 "setup": [
447 "$TC qdisc add dev $DEV1 ingress"
448 ],
449 "cmdUnderTest": "$TC filter add dev $DEV1 parent aa11b1b2: handle 1 prio 1 fw action ok",
450 "expExitCode": "255",
451 "verifyCmd": "$TC filter dev $DEV1 parent aa11b1b2: handle 1 prio 1 protocol all fw",
452 "matchPattern": "filter protocol all pref 1 fw.*handle 0x1.*gact action pass",
453 "matchCount": "0",
454 "teardown": [
455 "$TC qdisc del dev $DEV1 ingress"
456 ]
457 },
458 {
459 "id": "66e0",
460 "name": "Add fw filter with missing mandatory parent id",
461 "category": [
462 "filter",
463 "fw"
464 ],
465 "setup": [
466 "$TC qdisc add dev $DEV1 ingress"
467 ],
468 "cmdUnderTest": "$TC filter add dev $DEV1 handle 1 prio 1 fw action ok",
469 "expExitCode": "2",
470 "verifyCmd": "$TC filter get dev $DEV1 parent ffff: handle 1 prio 1 protocol all fw",
471 "matchPattern": "pref [0-9]+ fw.*handle 0x1.*gact action pass",
472 "matchCount": "0",
473 "teardown": [
474 "$TC qdisc del dev $DEV1 ingress"
475 ]
476 },
477 {
478 "id": "0ff3",
479 "name": "Add fw filter with classid",
480 "category": [
481 "filter",
482 "fw"
483 ],
484 "setup": [
485 "$TC qdisc add dev $DEV1 ingress"
486 ],
487 "cmdUnderTest": "$TC filter add dev $DEV1 parent ffff: handle 1 prio 1 fw classid 3 action ok",
488 "expExitCode": "0",
489 "verifyCmd": "$TC filter get dev $DEV1 parent ffff: handle 1 prio 1 protocol all fw",
490 "matchPattern": "fw.*handle 0x1 classid :3.*gact action pass",
491 "matchCount": "1",
492 "teardown": [
493 "$TC qdisc del dev $DEV1 ingress"
494 ]
495 },
496 {
497 "id": "9849",
498 "name": "Add fw filter with classid at root",
499 "category": [
500 "filter",
501 "fw"
502 ],
503 "setup": [
504 "$TC qdisc add dev $DEV1 ingress"
505 ],
506 "cmdUnderTest": "$TC filter add dev $DEV1 parent ffff: handle 1 prio 1 fw classid ffff:ffff action ok",
507 "expExitCode": "0",
508 "verifyCmd": "$TC filter get dev $DEV1 parent ffff: handle 1 prio 1 protocol all fw",
509 "matchPattern": "pref 1 fw.*handle 0x1 classid root.*gact action pass",
510 "matchCount": "1",
511 "teardown": [
512 "$TC qdisc del dev $DEV1 ingress"
513 ]
514 },
515 {
516 "id": "b7ff",
517 "name": "Add fw filter with classid - keeps last 8 (hex) digits",
518 "category": [
519 "filter",
520 "fw"
521 ],
522 "setup": [
523 "$TC qdisc add dev $DEV1 ingress"
524 ],
525 "cmdUnderTest": "$TC filter add dev $DEV1 parent ffff: handle 1 prio 1 fw classid 98765fedcb action ok",
526 "expExitCode": "0",
527 "verifyCmd": "$TC filter get dev $DEV1 parent ffff: handle 1 prio 1 protocol all fw",
528 "matchPattern": "fw.*handle 0x1 classid 765f:edcb.*gact action pass",
529 "matchCount": "1",
530 "teardown": [
531 "$TC qdisc del dev $DEV1 ingress"
532 ]
533 },
534 {
535 "id": "2b18",
536 "name": "Add fw filter with invalid classid",
537 "category": [
538 "filter",
539 "fw"
540 ],
541 "setup": [
542 "$TC qdisc add dev $DEV1 ingress"
543 ],
544 "cmdUnderTest": "$TC filter add dev $DEV1 parent ffff: handle 1 prio 1 fw classid 6789defg action ok",
545 "expExitCode": "1",
546 "verifyCmd": "$TC filter get dev $DEV1 parent ffff: handle 1 prio 1 protocol all fw",
547 "matchPattern": "fw.*handle 0x1 classid 6789:defg.*gact action pass",
548 "matchCount": "0",
549 "teardown": [
550 "$TC qdisc del dev $DEV1 ingress"
551 ]
552 },
553 {
554 "id": "fade",
555 "name": "Add fw filter with flowid",
556 "category": [
557 "filter",
558 "fw"
559 ],
560 "setup": [
561 "$TC qdisc add dev $DEV1 ingress"
562 ],
563 "cmdUnderTest": "$TC filter add dev $DEV1 parent ffff: handle 10 prio 1 fw flowid 1:10 action ok",
564 "expExitCode": "0",
565 "verifyCmd": "$TC filter get dev $DEV1 parent ffff: handle 10 prio 1 protocol all fw",
566 "matchPattern": "filter parent ffff: protocol all pref 1 fw.*handle 0xa classid 1:10.*gact action pass",
567 "matchCount": "1",
568 "teardown": [
569 "$TC qdisc del dev $DEV1 ingress"
570 ]
571 },
572 {
573 "id": "33af",
574 "name": "Add fw filter with flowid then classid (same arg, takes second)",
575 "category": [
576 "filter",
577 "fw"
578 ],
579 "setup": [
580 "$TC qdisc add dev $DEV1 ingress"
581 ],
582 "cmdUnderTest": "$TC filter add dev $DEV1 parent ffff: handle 11 prio 1 fw flowid 10 classid 4 action ok",
583 "expExitCode": "0",
584 "verifyCmd": "$TC filter get dev $DEV1 parent ffff: handle 11 prio 1 protocol all fw",
585 "matchPattern": "filter parent ffff: protocol all pref 1 fw.*handle 0xb classid :4.*gact action pass",
586 "matchCount": "1",
587 "teardown": [
588 "$TC qdisc del dev $DEV1 ingress"
589 ]
590 },
591 {
592 "id": "8a8c",
593 "name": "Add fw filter with classid then flowid (same arg, takes second)",
594 "category": [
595 "filter",
596 "fw"
597 ],
598 "setup": [
599 "$TC qdisc add dev $DEV1 ingress"
600 ],
601 "cmdUnderTest": "$TC filter add dev $DEV1 parent ffff: handle 11 prio 1 fw classid 4 flowid 10 action ok",
602 "expExitCode": "0",
603 "verifyCmd": "$TC filter get dev $DEV1 parent ffff: handle 11 prio 1 protocol all fw",
604 "matchPattern": "filter parent ffff: protocol all pref 1 fw.*handle 0xb classid :10.*gact action pass",
605 "matchCount": "1",
606 "teardown": [
607 "$TC qdisc del dev $DEV1 ingress"
608 ]
609 },
610 {
611 "id": "b50d",
612 "name": "Add fw filter with handle val/mask and flowid 10:1000",
613 "category": [
614 "filter",
615 "fw"
616 ],
617 "setup": [
618 "$TC qdisc add dev $DEV1 ingress"
619 ],
620 "cmdUnderTest": "$TC filter add dev $DEV1 parent ffff: prio 3 handle 10/0xff fw flowid 10:1000 action ok",
621 "expExitCode": "0",
622 "verifyCmd": "$TC filter get dev $DEV1 parent ffff: handle 10 prio 3 protocol all fw",
623 "matchPattern": "filter parent ffff: protocol all pref 3 fw.*handle 0xa/0xff classid 10:1000.*gact action pass",
624 "matchCount": "1",
625 "teardown": [
626 "$TC qdisc del dev $DEV1 ingress"
627 ]
628 },
629 {
630 "id": "7207",
631 "name": "Add fw filter with protocol ip",
632 "category": [
633 "filter",
634 "fw"
635 ],
636 "setup": [
637 "$TC qdisc add dev $DEV1 ingress"
638 ],
639 "cmdUnderTest": "$TC filter add dev $DEV1 parent ffff: protocol ip prio 1 handle 3 fw action ok",
640 "expExitCode": "0",
641 "verifyCmd": "$TC filter get dev $DEV1 parent ffff: handle 3 prio 1 protocol ip fw",
642 "matchPattern": "filter parent ffff: protocol ip pref 1 fw.*handle 0x3.*gact action pass.*index [0-9]+ ref [0-9]+ bind [0-9]+",
643 "matchCount": "1",
644 "teardown": [
645 "$TC qdisc del dev $DEV1 ingress"
646 ]
647 },
648 {
649 "id": "306d",
650 "name": "Add fw filter with protocol ipv6",
651 "category": [
652 "filter",
653 "fw"
654 ],
655 "setup": [
656 "$TC qdisc add dev $DEV1 ingress"
657 ],
658 "cmdUnderTest": "$TC filter add dev $DEV1 parent ffff: protocol ipv6 prio 2 handle 4 fw action ok",
659 "expExitCode": "0",
660 "verifyCmd": "$TC filter get dev $DEV1 parent ffff: handle 4 prio 2 protocol ipv6 fw",
661 "matchPattern": "filter parent ffff: protocol ipv6 pref 2 fw.*handle 0x4.*gact action pass.*index [0-9]+ ref [0-9]+ bind [0-9]+",
662 "matchCount": "1",
663 "teardown": [
664 "$TC qdisc del dev $DEV1 ingress"
665 ]
666 },
667 {
668 "id": "9a78",
669 "name": "Add fw filter with protocol arp",
670 "category": [
671 "filter",
672 "fw"
673 ],
674 "setup": [
675 "$TC qdisc add dev $DEV1 ingress"
676 ],
677 "cmdUnderTest": "$TC filter add dev $DEV1 parent ffff: protocol arp prio 5 handle 7 fw action drop",
678 "expExitCode": "0",
679 "verifyCmd": "$TC filter get dev $DEV1 parent ffff: handle 7 prio 5 protocol arp fw",
680 "matchPattern": "filter parent ffff: protocol arp pref 5 fw.*handle 0x7.*gact action drop.*index [0-9]+ ref [0-9]+ bind [0-9]+",
681 "matchCount": "1",
682 "teardown": [
683 "$TC qdisc del dev $DEV1 ingress"
684 ]
685 },
686 {
687 "id": "1821",
688 "name": "Add fw filter with protocol 802_3",
689 "category": [
690 "filter",
691 "fw"
692 ],
693 "setup": [
694 "$TC qdisc add dev $DEV1 ingress"
695 ],
696 "cmdUnderTest": "$TC filter add dev $DEV1 parent ffff: protocol 802_3 handle 1 prio 1 fw action ok",
697 "expExitCode": "0",
698 "verifyCmd": "$TC filter get dev $DEV1 parent ffff: handle 1 prio 1 protocol 802_3 fw",
699 "matchPattern": "filter parent ffff: protocol 802_3 pref 1 fw.*handle 0x1.*gact action pass",
700 "matchCount": "1",
701 "teardown": [
702 "$TC qdisc del dev $DEV1 ingress"
703 ]
704 },
705 {
706 "id": "2260",
707 "name": "Add fw filter with invalid protocol",
708 "category": [
709 "filter",
710 "fw"
711 ],
712 "setup": [
713 "$TC qdisc add dev $DEV1 ingress"
714 ],
715 "cmdUnderTest": "$TC filter add dev $DEV1 parent ffff: protocol igmp handle 1 prio 1 fw action ok",
716 "expExitCode": "255",
717 "verifyCmd": "$TC filter get dev $DEV1 parent ffff: handle 1 prio 1 protocol igmp fw",
718 "matchPattern": "filter parent ffff: protocol igmp pref 1 fw.*handle 0x1.*gact action pass",
719 "matchCount": "0",
720 "teardown": [
721 "$TC qdisc del dev $DEV1 ingress"
722 ]
723 },
724 {
725 "id": "09d7",
726 "name": "Add fw filters protocol 802_3 and ip with conflicting priorities",
727 "category": [
728 "filter",
729 "fw"
730 ],
731 "setup": [
732 "$TC qdisc add dev $DEV1 ingress",
733 "$TC filter add dev $DEV1 parent ffff: protocol 802_3 prio 3 handle 7 fw action ok"
734 ],
735 "cmdUnderTest": "$TC filter add dev $DEV1 parent ffff: protocol ip prio 3 handle 8 fw action ok",
736 "expExitCode": "2",
737 "verifyCmd": "$TC filter get dev $DEV1 parent ffff: handle 8 prio 3 protocol ip fw",
738 "matchPattern": "filter parent ffff: protocol ip pref 3 fw.*handle 0x8",
739 "matchCount": "0",
740 "teardown": [
741 "$TC qdisc del dev $DEV1 ingress"
742 ]
743 },
744 {
745 "id": "6973",
746 "name": "Add fw filters with same index, same action",
747 "category": [
748 "filter",
749 "fw"
750 ],
751 "setup": [
752 "$TC qdisc add dev $DEV1 ingress",
753 "$TC filter add dev $DEV1 parent ffff: prio 6 handle 2 fw action continue index 5"
754 ],
755 "cmdUnderTest": "$TC filter add dev $DEV1 parent ffff: prio 8 handle 4 fw action continue index 5",
756 "expExitCode": "0",
757 "verifyCmd": "$TC filter get dev $DEV1 parent ffff: handle 4 prio 8 protocol all fw",
758 "matchPattern": "filter parent ffff: protocol all pref 8 fw.*handle 0x4.*gact action continue.*index 5 ref 2 bind 2",
759 "matchCount": "1",
760 "teardown": [
761 "$TC qdisc del dev $DEV1 ingress"
762 ]
763 },
764 {
765 "id": "fc06",
766 "name": "Add fw filters with action police",
767 "category": [
768 "filter",
769 "fw"
770 ],
771 "setup": [
772 "$TC qdisc add dev $DEV1 ingress"
773 ],
774 "cmdUnderTest": "$TC filter add dev $DEV1 parent ffff: prio 3 handle 4 fw action police rate 1kbit burst 10k index 5",
775 "expExitCode": "0",
776 "verifyCmd": "$TC filter get dev $DEV1 parent ffff: handle 4 prio 3 protocol all fw",
777 "matchPattern": "filter parent ffff: protocol all pref 3 fw.*handle 0x4.*police 0x5 rate 1Kbit burst 10Kb mtu 2Kb action reclassify overhead 0b.*ref 1 bind 1",
778 "matchCount": "1",
779 "teardown": [
780 "$TC qdisc del dev $DEV1 ingress"
781 ]
782 },
783 {
784 "id": "aac7",
785 "name": "Add fw filters with action police linklayer atm",
786 "category": [
787 "filter",
788 "fw"
789 ],
790 "setup": [
791 "$TC qdisc add dev $DEV1 ingress"
792 ],
793 "cmdUnderTest": "$TC filter add dev $DEV1 parent ffff: prio 3 handle 4 fw action police rate 2mbit burst 200k linklayer atm index 8",
794 "expExitCode": "0",
795 "verifyCmd": "$TC filter get dev $DEV1 parent ffff: handle 4 prio 3 protocol all fw",
796 "matchPattern": "filter parent ffff: protocol all pref 3 fw.*handle 0x4.*police 0x8 rate 2Mbit burst 200Kb mtu 2Kb action reclassify overhead 0b linklayer atm.*ref 1 bind 1",
797 "matchCount": "1",
798 "teardown": [
799 "$TC qdisc del dev $DEV1 ingress"
800 ]
801 },
802 {
803 "id": "5339",
804 "name": "Del entire fw filter",
805 "category": [
806 "filter",
807 "fw"
808 ],
809 "setup": [
810 "$TC qdisc add dev $DEV1 ingress",
811 "$TC filter add dev $DEV1 parent ffff: handle 5 prio 7 fw action pass",
812 "$TC filter add dev $DEV1 parent ffff: handle 3 prio 9 fw action pass"
813 ],
814 "cmdUnderTest": "$TC filter del dev $DEV1 parent ffff:",
815 "expExitCode": "0",
816 "verifyCmd": "$TC filter show dev $DEV1 parent ffff:",
817 "matchPattern": "protocol all pref.*handle.*gact action pass",
818 "matchCount": "0",
819 "teardown": [
820 "$TC qdisc del dev $DEV1 ingress"
821 ]
822 },
823 {
824 "id": "0e99",
825 "name": "Del single fw filter x1",
826 "__comment__": "First of two tests to check that one filter is there and the other isn't",
827 "category": [
828 "filter",
829 "fw"
830 ],
831 "setup": [
832 "$TC qdisc add dev $DEV1 ingress",
833 "$TC filter add dev $DEV1 parent ffff: handle 5 prio 7 fw action pass",
834 "$TC filter add dev $DEV1 parent ffff: handle 3 prio 9 fw action pass"
835 ],
836 "cmdUnderTest": "$TC filter del dev $DEV1 parent ffff: handle 3 prio 9 fw action pass",
837 "expExitCode": "0",
838 "verifyCmd": "$TC filter show dev $DEV1 parent ffff:",
839 "matchPattern": "protocol all pref 7.*handle 0x5.*gact action pass",
840 "matchCount": "1",
841 "teardown": [
842 "$TC qdisc del dev $DEV1 ingress"
843 ]
844 },
845 {
846 "id": "f54c",
847 "name": "Del single fw filter x2",
848 "__comment__": "Second of two tests to check that one filter is there and the other isn't",
849 "category": [
850 "filter",
851 "fw"
852 ],
853 "setup": [
854 "$TC qdisc add dev $DEV1 ingress",
855 "$TC filter add dev $DEV1 parent ffff: handle 5 prio 7 fw action pass",
856 "$TC filter add dev $DEV1 parent ffff: handle 3 prio 9 fw action pass"
857 ],
858 "cmdUnderTest": "$TC filter del dev $DEV1 parent ffff: handle 3 prio 9 fw action pass",
859 "expExitCode": "0",
860 "verifyCmd": "$TC filter show dev $DEV1 parent ffff:",
861 "matchPattern": "protocol all pref 9.*handle 0x3.*gact action pass",
862 "matchCount": "0",
863 "teardown": [
864 "$TC qdisc del dev $DEV1 ingress"
865 ]
866 },
867 {
868 "id": "ba94",
869 "name": "Del fw filter by prio",
870 "category": [
871 "filter",
872 "fw"
873 ],
874 "setup": [
875 "$TC qdisc add dev $DEV1 ingress",
876 "$TC filter add dev $DEV1 parent ffff: handle 1 prio 4 fw action ok",
877 "$TC filter add dev $DEV1 parent ffff: handle 2 prio 4 fw action ok"
878 ],
879 "cmdUnderTest": "$TC filter del dev $DEV1 parent ffff: prio 4",
880 "expExitCode": "0",
881 "verifyCmd": "$TC filter show dev $DEV1 parent ffff:",
882 "matchPattern": "pref 4 fw.*gact action pass",
883 "matchCount": "0",
884 "teardown": [
885 "$TC qdisc del dev $DEV1 ingress"
886 ]
887 },
888 {
889 "id": "4acb",
890 "name": "Del fw filter by chain",
891 "category": [
892 "filter",
893 "fw"
894 ],
895 "setup": [
896 "$TC qdisc add dev $DEV1 ingress",
897 "$TC filter add dev $DEV1 parent ffff: handle 4 prio 2 chain 13 fw action pipe",
898 "$TC filter add dev $DEV1 parent ffff: handle 3 prio 5 chain 13 fw action pipe"
899 ],
900 "cmdUnderTest": "$TC filter del dev $DEV1 parent ffff: chain 13",
901 "expExitCode": "0",
902 "verifyCmd": "$TC filter show dev $DEV1 parent ffff:",
903 "matchPattern": "fw chain 13 handle.*gact action pipe",
904 "matchCount": "0",
905 "teardown": [
906 "$TC qdisc del dev $DEV1 ingress"
907 ]
908 },
909 {
910 "id": "3424",
911 "name": "Del fw filter by action (invalid)",
912 "category": [
913 "filter",
914 "fw"
915 ],
916 "setup": [
917 "$TC qdisc add dev $DEV1 ingress",
918 "$TC filter add dev $DEV1 parent ffff: handle 2 prio 4 fw action drop"
919 ],
920 "cmdUnderTest": "$TC filter del dev $DEV1 parent ffff: fw action drop",
921 "expExitCode": "2",
922 "verifyCmd": "$TC filter get dev $DEV1 parent ffff: handle 2 prio 4 protocol all fw",
923 "matchPattern": "handle 0x2.*gact action drop",
924 "matchCount": "1",
925 "teardown": [
926 "$TC qdisc del dev $DEV1 ingress"
927 ]
928 },
929 {
930 "id": "da89",
931 "name": "Del fw filter by handle (invalid)",
932 "category": [
933 "filter",
934 "fw"
935 ],
936 "setup": [
937 "$TC qdisc add dev $DEV1 ingress",
938 "$TC filter add dev $DEV1 parent ffff: handle 3 prio 4 fw action continue"
939 ],
940 "cmdUnderTest": "$TC filter del dev $DEV1 parent ffff: handle 3 fw",
941 "expExitCode": "2",
942 "verifyCmd": "$TC filter get dev $DEV1 parent ffff: handle 3 prio 4 protocol all fw",
943 "matchPattern": "handle 0x3.*gact action continue",
944 "matchCount": "1",
945 "teardown": [
946 "$TC qdisc del dev $DEV1 ingress"
947 ]
948 },
949 {
950 "id": "4d95",
951 "name": "Del fw filter by protocol (invalid)",
952 "category": [
953 "filter",
954 "fw"
955 ],
956 "setup": [
957 "$TC qdisc add dev $DEV1 ingress",
958 "$TC filter add dev $DEV1 parent ffff: handle 4 prio 2 protocol arp fw action pipe"
959 ],
960 "cmdUnderTest": "$TC filter del dev $DEV1 parent ffff: protocol arp fw",
961 "expExitCode": "2",
962 "verifyCmd": "$TC filter get dev $DEV1 parent ffff: handle 4 prio 2 protocol arp fw",
963 "matchPattern": "filter parent ffff: protocol arp.*handle 0x4.*gact action pipe",
964 "matchCount": "1",
965 "teardown": [
966 "$TC qdisc del dev $DEV1 ingress"
967 ]
968 },
969 {
970 "id": "4736",
971 "name": "Del fw filter by flowid (invalid)",
972 "category": [
973 "filter",
974 "fw"
975 ],
976 "setup": [
977 "$TC qdisc add dev $DEV1 ingress",
978 "$TC filter add dev $DEV1 parent ffff: handle 4 prio 2 fw action pipe flowid 45"
979 ],
980 "cmdUnderTest": "$TC filter del dev $DEV1 parent ffff: fw flowid 45",
981 "expExitCode": "2",
982 "verifyCmd": "$TC filter show dev $DEV1 parent ffff:",
983 "matchPattern": "handle 0x4.*gact action pipe",
984 "matchCount": "1",
985 "teardown": [
986 "$TC qdisc del dev $DEV1 ingress"
987 ]
988 },
989 {
990 "id": "3dcb",
991 "name": "Replace fw filter action",
992 "category": [
993 "filter",
994 "fw"
995 ],
996 "setup": [
997 "$TC qdisc add dev $DEV1 ingress",
998 "$TC filter add dev $DEV1 parent ffff: handle 1 prio 2 fw action ok"
999 ],
1000 "cmdUnderTest": "$TC filter replace dev $DEV1 parent ffff: handle 1 prio 2 fw action pipe",
1001 "expExitCode": "0",
1002 "verifyCmd": "$TC filter show dev $DEV1 parent ffff:",
1003 "matchPattern": "pref 2 fw.*handle 0x1.*gact action pipe",
1004 "matchCount": "1",
1005 "teardown": [
1006 "$TC qdisc del dev $DEV1 ingress"
1007 ]
1008 },
1009 {
1010 "id": "eb4d",
1011 "name": "Replace fw filter classid",
1012 "category": [
1013 "filter",
1014 "fw"
1015 ],
1016 "setup": [
1017 "$TC qdisc add dev $DEV1 ingress",
1018 "$TC filter add dev $DEV1 parent ffff: handle 1 prio 2 fw action ok"
1019 ],
1020 "cmdUnderTest": "$TC filter replace dev $DEV1 parent ffff: handle 1 prio 2 fw action pipe classid 2",
1021 "expExitCode": "0",
1022 "verifyCmd": "$TC filter show dev $DEV1 parent ffff:",
1023 "matchPattern": "pref 2 fw.*handle 0x1 classid :2.*gact action pipe",
1024 "matchCount": "1",
1025 "teardown": [
1026 "$TC qdisc del dev $DEV1 ingress"
1027 ]
1028 },
1029 {
1030 "id": "67ec",
1031 "name": "Replace fw filter index",
1032 "category": [
1033 "filter",
1034 "fw"
1035 ],
1036 "setup": [
1037 "$TC qdisc add dev $DEV1 ingress",
1038 "$TC filter add dev $DEV1 parent ffff: handle 1 prio 2 fw action ok index 3"
1039 ],
1040 "cmdUnderTest": "$TC filter replace dev $DEV1 parent ffff: handle 1 prio 2 fw action ok index 16",
1041 "expExitCode": "0",
1042 "verifyCmd": "$TC filter show dev $DEV1 parent ffff:",
1043 "matchPattern": "pref 2 fw.*handle 0x1.*gact action pass.*index 16",
1044 "matchCount": "1",
1045 "teardown": [
1046 "$TC qdisc del dev $DEV1 ingress"
1047 ]
1048 }
1049]