Skip to content

Commit 5c4b513

Browse files
Roman Mashakdavem330
authored andcommitted
tc-testing: updated tdc tests for basic filter with u16 extended match rules
Signed-off-by: Roman Mashak <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent f1d97dd commit 5c4b513

File tree

1 file changed

+242
-0
lines changed
  • tools/testing/selftests/tc-testing/tc-tests/filters

1 file changed

+242
-0
lines changed

tools/testing/selftests/tc-testing/tc-tests/filters/basic.json

Lines changed: 242 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,5 +614,247 @@
614614
"teardown": [
615615
"$TC qdisc del dev $DEV1 ingress"
616616
]
617+
},
618+
{
619+
"id": "1d85",
620+
"name": "Add basic filter with u32 ematch u16/zero offset and default action",
621+
"category": [
622+
"filter",
623+
"basic"
624+
],
625+
"plugins": {
626+
"requires": "nsPlugin"
627+
},
628+
"setup": [
629+
"$TC qdisc add dev $DEV1 ingress"
630+
],
631+
"cmdUnderTest": "$TC filter add dev $DEV1 parent ffff: handle 1 protocol ip prio 1 basic match 'u32(u16 0x1122 0xffff at 0)' classid 1:1",
632+
"expExitCode": "0",
633+
"verifyCmd": "$TC filter get dev $DEV1 parent ffff: handle 1 prio 1 protocol ip basic",
634+
"matchPattern": "^filter parent ffff: protocol ip pref 1 basic.*handle 0x1 flowid 1:1.*u32\\(11220000/ffff0000 at 0\\)",
635+
"matchCount": "1",
636+
"teardown": [
637+
"$TC qdisc del dev $DEV1 ingress"
638+
]
639+
},
640+
{
641+
"id": "3672",
642+
"name": "Add basic filter with u32 ematch u16/zero offset and invalid value >0xFFFF",
643+
"category": [
644+
"filter",
645+
"basic"
646+
],
647+
"plugins": {
648+
"requires": "nsPlugin"
649+
},
650+
"setup": [
651+
"$TC qdisc add dev $DEV1 ingress"
652+
],
653+
"cmdUnderTest": "$TC filter add dev $DEV1 parent ffff: handle 1 protocol ip prio 1 basic match 'u32(u16 0x112233 0xffff at 0)' classid 1:1",
654+
"expExitCode": "1",
655+
"verifyCmd": "$TC filter get dev $DEV1 parent ffff: handle 1 prio 1 protocol ip basic",
656+
"matchPattern": "^filter parent ffff: protocol ip pref 1 basic.*handle 0x1 flowid 1:1.*u32\\(11223300/ffff0000 at 0\\)",
657+
"matchCount": "0",
658+
"teardown": [
659+
"$TC qdisc del dev $DEV1 ingress"
660+
]
661+
},
662+
{
663+
"id": "7fb0",
664+
"name": "Add basic filter with u32 ematch u16/positive offset and default action",
665+
"category": [
666+
"filter",
667+
"basic"
668+
],
669+
"plugins": {
670+
"requires": "nsPlugin"
671+
},
672+
"setup": [
673+
"$TC qdisc add dev $DEV1 ingress"
674+
],
675+
"cmdUnderTest": "$TC filter add dev $DEV1 parent ffff: handle 1 protocol ip prio 1 basic match 'u32(u16 0x7788 0x1fff at 12)' classid 1:1",
676+
"expExitCode": "0",
677+
"verifyCmd": "$TC filter get dev $DEV1 parent ffff: handle 1 prio 1 protocol ip basic",
678+
"matchPattern": "^filter parent ffff: protocol ip pref 1 basic.*handle 0x1 flowid 1:1.*u32\\(17880000/1fff0000 at 12\\)",
679+
"matchCount": "1",
680+
"teardown": [
681+
"$TC qdisc del dev $DEV1 ingress"
682+
]
683+
},
684+
{
685+
"id": "19af",
686+
"name": "Add basic filter with u32 ematch u16/invalid mask >0xFFFF",
687+
"category": [
688+
"filter",
689+
"basic"
690+
],
691+
"plugins": {
692+
"requires": "nsPlugin"
693+
},
694+
"setup": [
695+
"$TC qdisc add dev $DEV1 ingress"
696+
],
697+
"cmdUnderTest": "$TC filter add dev $DEV1 parent ffff: handle 1 protocol ip prio 1 basic match 'u32(u16 0x7788 0xffffffff at 12)' classid 1:1",
698+
"expExitCode": "1",
699+
"verifyCmd": "$TC filter get dev $DEV1 parent ffff: handle 1 prio 1 protocol ip basic",
700+
"matchPattern": "^filter parent ffff: protocol ip pref 1 basic.*handle 0x1 flowid 1:1.*u32\\(77880000/ffffffff at 12\\)",
701+
"matchCount": "0",
702+
"teardown": [
703+
"$TC qdisc del dev $DEV1 ingress"
704+
]
705+
},
706+
{
707+
"id": "446d",
708+
"name": "Add basic filter with u32 ematch u16/missing offset",
709+
"category": [
710+
"filter",
711+
"basic"
712+
],
713+
"plugins": {
714+
"requires": "nsPlugin"
715+
},
716+
"setup": [
717+
"$TC qdisc add dev $DEV1 ingress"
718+
],
719+
"cmdUnderTest": "$TC filter add dev $DEV1 parent ffff: handle 1 protocol ip prio 1 basic match 'u32(u16 0x7788 0xffff at)' classid 1:1",
720+
"expExitCode": "1",
721+
"verifyCmd": "$TC filter get dev $DEV1 parent ffff: handle 1 prio 1 protocol ip basic",
722+
"matchPattern": "^filter parent ffff: protocol ip pref 1 basic.*handle 0x1 flowid 1:1.*u32\\(77880000 at 12\\)",
723+
"matchCount": "0",
724+
"teardown": [
725+
"$TC qdisc del dev $DEV1 ingress"
726+
]
727+
},
728+
{
729+
"id": "151b",
730+
"name": "Add basic filter with u32 ematch u16/missing AT keyword",
731+
"category": [
732+
"filter",
733+
"basic"
734+
],
735+
"plugins": {
736+
"requires": "nsPlugin"
737+
},
738+
"setup": [
739+
"$TC qdisc add dev $DEV1 ingress"
740+
],
741+
"cmdUnderTest": "$TC filter add dev $DEV1 parent ffff: handle 1 protocol ip prio 1 basic match 'u32(u16 0x7788 0xffff 0)' classid 1:1",
742+
"expExitCode": "1",
743+
"verifyCmd": "$TC filter get dev $DEV1 parent ffff: handle 1 prio 1 protocol ip basic",
744+
"matchPattern": "^filter parent ffff: protocol ip pref 1 basic.*handle 0x1 flowid 1:1.*u32\\(77880000/ffff0000 at 0\\)",
745+
"matchCount": "0",
746+
"teardown": [
747+
"$TC qdisc del dev $DEV1 ingress"
748+
]
749+
},
750+
{
751+
"id": "bb23",
752+
"name": "Add basic filter with u32 ematch u16/missing value",
753+
"category": [
754+
"filter",
755+
"basic"
756+
],
757+
"plugins": {
758+
"requires": "nsPlugin"
759+
},
760+
"setup": [
761+
"$TC qdisc add dev $DEV1 ingress"
762+
],
763+
"cmdUnderTest": "$TC filter add dev $DEV1 parent ffff: handle 1 protocol ip prio 1 basic match 'u32(u16 at 12)' classid 1:1",
764+
"expExitCode": "1",
765+
"verifyCmd": "$TC filter get dev $DEV1 parent ffff: handle 1 prio 1 protocol ip basic",
766+
"matchPattern": "^filter parent ffff: protocol ip pref 1 basic.*handle 0x1 flowid 1:1.*u32\\(at 12\\)",
767+
"matchCount": "0",
768+
"teardown": [
769+
"$TC qdisc del dev $DEV1 ingress"
770+
]
771+
},
772+
{
773+
"id": "decc",
774+
"name": "Add basic filter with u32 ematch u16/non-numeric value",
775+
"category": [
776+
"filter",
777+
"basic"
778+
],
779+
"plugins": {
780+
"requires": "nsPlugin"
781+
},
782+
"setup": [
783+
"$TC qdisc add dev $DEV1 ingress"
784+
],
785+
"cmdUnderTest": "$TC filter add dev $DEV1 parent ffff: handle 1 protocol ip prio 1 basic match 'u32(u16 zero 0xffff at 0)' classid 1:1",
786+
"expExitCode": "1",
787+
"verifyCmd": "$TC filter get dev $DEV1 parent ffff: handle 1 prio 1 protocol ip basic",
788+
"matchPattern": "^filter parent ffff: protocol ip pref 1 basic.*handle 0x1 flowid 1:1.*u32\\(00000000/ffff0000 at 0\\)",
789+
"matchCount": "0",
790+
"teardown": [
791+
"$TC qdisc del dev $DEV1 ingress"
792+
]
793+
},
794+
{
795+
"id": "e988",
796+
"name": "Add basic filter with u32 ematch u16/non-numeric mask",
797+
"category": [
798+
"filter",
799+
"basic"
800+
],
801+
"plugins": {
802+
"requires": "nsPlugin"
803+
},
804+
"setup": [
805+
"$TC qdisc add dev $DEV1 ingress"
806+
],
807+
"cmdUnderTest": "$TC filter add dev $DEV1 parent ffff: handle 1 protocol ip prio 1 basic match 'u32(u8 0x1122 mask at 0)' classid 1:1",
808+
"expExitCode": "1",
809+
"verifyCmd": "$TC filter get dev $DEV1 parent ffff: handle 1 prio 1 protocol ip basic",
810+
"matchPattern": "^filter parent ffff: protocol ip pref 1 basic.*handle 0x1 flowid 1:1.*u32\\(11220000/00000000 at 0\\)",
811+
"matchCount": "0",
812+
"teardown": [
813+
"$TC qdisc del dev $DEV1 ingress"
814+
]
815+
},
816+
{
817+
"id": "07d8",
818+
"name": "Add basic filter with u32 ematch u16/negative offset and default action",
819+
"category": [
820+
"filter",
821+
"basic"
822+
],
823+
"plugins": {
824+
"requires": "nsPlugin"
825+
},
826+
"setup": [
827+
"$TC qdisc add dev $DEV1 ingress"
828+
],
829+
"cmdUnderTest": "$TC filter add dev $DEV1 parent ffff: handle 1 protocol ip prio 1 basic match 'u32(u16 0xaabb 0xffff at -12)' classid 1:1",
830+
"expExitCode": "0",
831+
"verifyCmd": "$TC filter get dev $DEV1 parent ffff: handle 1 prio 1 protocol ip basic",
832+
"matchPattern": "^filter parent ffff: protocol ip pref 1 basic.*handle 0x1 flowid 1:1.*u32\\(aabb0000/ffff0000 at -12\\)",
833+
"matchCount": "1",
834+
"teardown": [
835+
"$TC qdisc del dev $DEV1 ingress"
836+
]
837+
},
838+
{
839+
"id": "f474",
840+
"name": "Add basic filter with u32 ematch u16/nexthdr+ offset and default action",
841+
"category": [
842+
"filter",
843+
"basic"
844+
],
845+
"plugins": {
846+
"requires": "nsPlugin"
847+
},
848+
"setup": [
849+
"$TC qdisc add dev $DEV1 ingress"
850+
],
851+
"cmdUnderTest": "$TC filter add dev $DEV1 parent ffff: handle 1 protocol ip prio 1 basic match 'u32(u16 0xaabb 0xf0f0 at nexthdr+0)' classid 1:1",
852+
"expExitCode": "0",
853+
"verifyCmd": "$TC filter get dev $DEV1 parent ffff: handle 1 prio 1 protocol ip basic",
854+
"matchPattern": "^filter parent ffff: protocol ip pref 1 basic.*handle 0x1 flowid 1:1.*u32\\(a0b00000/f0f00000 at nexthdr\\+0\\)",
855+
"matchCount": "1",
856+
"teardown": [
857+
"$TC qdisc del dev $DEV1 ingress"
858+
]
617859
}
618860
]

0 commit comments

Comments
 (0)