Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

selftests/tc-testing: Create tests to exercise act_ct binding restrictions

Add 4 test cases to exercise new act_ct binding restrictions:

- Try to attach act_ct to an ets qdisc
- Attach act_ct to an ingress qdisc
- Attach act_ct to a clsact/egress qdisc
- Attach act_ct to a shared block

Signed-off-by: Victor Nogueira <victor@mojatatu.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Link: https://patch.msgid.link/20260225134349.1287037-2-victor@mojatatu.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Victor Nogueira and committed by
Jakub Kicinski
b14e82ab 11cb63b0

+159
+159
tools/testing/selftests/tc-testing/tc-tests/actions/ct.json
··· 505 505 "teardown": [ 506 506 "$TC qdisc del dev $DEV1 ingress" 507 507 ] 508 + }, 509 + { 510 + "id": "8883", 511 + "name": "Try to attach act_ct to an ets qdisc", 512 + "category": [ 513 + "actions", 514 + "ct" 515 + ], 516 + "plugins": { 517 + "requires": "nsPlugin" 518 + }, 519 + "setup": [ 520 + [ 521 + "$TC actions flush action ct", 522 + 0, 523 + 1, 524 + 255 525 + ], 526 + "$TC qdisc add dev $DEV1 root handle 1: ets bands 2" 527 + ], 528 + "cmdUnderTest": "$TC filter add dev $DEV1 parent 1: prio 1 protocol ip matchall action ct index 42", 529 + "expExitCode": "2", 530 + "verifyCmd": "$TC -j filter ls dev $DEV1 parent 1: prio 1 protocol ip", 531 + "matchJSON": [], 532 + "teardown": [ 533 + "$TC qdisc del dev $DEV1 root" 534 + ] 535 + }, 536 + { 537 + "id": "3b10", 538 + "name": "Attach act_ct to an ingress qdisc", 539 + "category": [ 540 + "actions", 541 + "ct" 542 + ], 543 + "plugins": { 544 + "requires": "nsPlugin" 545 + }, 546 + "setup": [ 547 + [ 548 + "$TC actions flush action ct", 549 + 0, 550 + 1, 551 + 255 552 + ], 553 + "$TC qdisc add dev $DEV1 ingress" 554 + ], 555 + "cmdUnderTest": "$TC filter add dev $DEV1 ingress prio 1 protocol ip matchall action ct index 42", 556 + "expExitCode": "0", 557 + "verifyCmd": "$TC -j filter ls dev $DEV1 ingress prio 1 protocol ip", 558 + "matchJSON": [ 559 + { 560 + "kind": "matchall" 561 + }, 562 + { 563 + "options": { 564 + "actions": [ 565 + { 566 + "order": 1, 567 + "kind": "ct", 568 + "index": 42, 569 + "ref": 1, 570 + "bind": 1 571 + } 572 + ] 573 + } 574 + } 575 + ], 576 + "teardown": [ 577 + "$TC qdisc del dev $DEV1 ingress" 578 + ] 579 + }, 580 + { 581 + "id": "0337", 582 + "name": "Attach act_ct to a clsact/egress qdisc", 583 + "category": [ 584 + "actions", 585 + "ct" 586 + ], 587 + "plugins": { 588 + "requires": "nsPlugin" 589 + }, 590 + "setup": [ 591 + [ 592 + "$TC actions flush action ct", 593 + 0, 594 + 1, 595 + 255 596 + ], 597 + "$TC qdisc add dev $DEV1 clsact" 598 + ], 599 + "cmdUnderTest": "$TC filter add dev $DEV1 egress prio 1 protocol ip matchall action ct index 42", 600 + "expExitCode": "0", 601 + "verifyCmd": "$TC -j filter ls dev $DEV1 egress prio 1 protocol ip", 602 + "matchJSON": [ 603 + { 604 + "kind": "matchall" 605 + }, 606 + { 607 + "options": { 608 + "actions": [ 609 + { 610 + "order": 1, 611 + "kind": "ct", 612 + "index": 42, 613 + "ref": 1, 614 + "bind": 1 615 + } 616 + ] 617 + } 618 + } 619 + ], 620 + "teardown": [ 621 + "$TC qdisc del dev $DEV1 clsact" 622 + ] 623 + }, 624 + { 625 + "id": "4f60", 626 + "name": "Attach act_ct to a shared block", 627 + "category": [ 628 + "actions", 629 + "ct" 630 + ], 631 + "plugins": { 632 + "requires": "nsPlugin" 633 + }, 634 + "setup": [ 635 + [ 636 + "$TC actions flush action ct", 637 + 0, 638 + 1, 639 + 255 640 + ], 641 + "$TC qdisc add dev $DEV1 ingress_block 21 clsact" 642 + ], 643 + "cmdUnderTest": "$TC filter add block 21 prio 1 protocol ip matchall action ct index 42", 644 + "expExitCode": "0", 645 + "verifyCmd": "$TC -j filter ls block 21 prio 1 protocol ip", 646 + "matchJSON": [ 647 + { 648 + "kind": "matchall" 649 + }, 650 + { 651 + "options": { 652 + "actions": [ 653 + { 654 + "order": 1, 655 + "kind": "ct", 656 + "index": 42, 657 + "ref": 1, 658 + "bind": 1 659 + } 660 + ] 661 + } 662 + } 663 + ], 664 + "teardown": [ 665 + "$TC qdisc del dev $DEV1 ingress_block 21 clsact" 666 + ] 508 667 } 509 668 ]