hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/tools/testing/selftests/tc-testing/tc-tests/actions/mirred.json
....@@ -434,5 +434,148 @@
434434 "teardown": [
435435 "$TC actions flush action mirred"
436436 ]
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
+ "id": "31e3",
559
+ "name": "Add mirred mirror to egress action with no_percpu flag",
560
+ "category": [
561
+ "actions",
562
+ "mirred"
563
+ ],
564
+ "setup": [
565
+ [
566
+ "$TC actions flush action mirred",
567
+ 0,
568
+ 1,
569
+ 255
570
+ ]
571
+ ],
572
+ "cmdUnderTest": "$TC actions add action mirred egress mirror dev lo no_percpu",
573
+ "expExitCode": "0",
574
+ "verifyCmd": "$TC actions list action mirred",
575
+ "matchPattern": "action order [0-9]*: mirred \\(Egress Mirror to device lo\\).*no_percpu",
576
+ "matchCount": "1",
577
+ "teardown": [
578
+ "$TC actions flush action mirred"
579
+ ]
437580 }
438581 ]