176b903eeSLucas Bates[ 276b903eeSLucas Bates { 3b959ecf8SNicolas Dichtel "id": "2638", 4b959ecf8SNicolas Dichtel "name": "Add matchall and try to get it", 5b959ecf8SNicolas Dichtel "category": [ 6b959ecf8SNicolas Dichtel "filter", 7b959ecf8SNicolas Dichtel "matchall" 8b959ecf8SNicolas Dichtel ], 9489ce2f4SLucas Bates "plugins": { 10489ce2f4SLucas Bates "requires": "nsPlugin" 11489ce2f4SLucas Bates }, 12b959ecf8SNicolas Dichtel "setup": [ 13b959ecf8SNicolas Dichtel "$TC qdisc add dev $DEV1 clsact", 14b959ecf8SNicolas Dichtel "$TC filter add dev $DEV1 protocol all pref 1 ingress handle 0x1234 matchall action ok" 15b959ecf8SNicolas Dichtel ], 16b959ecf8SNicolas Dichtel "cmdUnderTest": "$TC filter get dev $DEV1 protocol all pref 1 ingress handle 0x1234 matchall", 17b959ecf8SNicolas Dichtel "expExitCode": "0", 18b959ecf8SNicolas Dichtel "verifyCmd": "$TC filter show dev $DEV1 ingress", 19b959ecf8SNicolas Dichtel "matchPattern": "filter protocol all pref 1 matchall chain 0 handle 0x1234", 20b959ecf8SNicolas Dichtel "matchCount": "1", 21b959ecf8SNicolas Dichtel "teardown": [ 22b959ecf8SNicolas Dichtel "$TC qdisc del dev $DEV1 clsact" 23b959ecf8SNicolas Dichtel ] 24b959ecf8SNicolas Dichtel }, 25b959ecf8SNicolas Dichtel { 2695b9395bSDavide Caratti "id": "2ff3", 2795b9395bSDavide Caratti "name": "Add flower with max handle and then dump it", 2895b9395bSDavide Caratti "category": [ 2995b9395bSDavide Caratti "filter", 3095b9395bSDavide Caratti "flower" 3195b9395bSDavide Caratti ], 3295b9395bSDavide Caratti "setup": [ 3395b9395bSDavide Caratti "$TC qdisc add dev $DEV2 ingress" 3495b9395bSDavide Caratti ], 350531b035SVlad Buslov "cmdUnderTest": "$TC filter add dev $DEV2 protocol ip pref 1 ingress handle 0xffffffff flower action ok", 3695b9395bSDavide Caratti "expExitCode": "0", 3795b9395bSDavide Caratti "verifyCmd": "$TC filter show dev $DEV2 ingress", 3895b9395bSDavide Caratti "matchPattern": "filter protocol ip pref 1 flower.*handle 0xffffffff", 3995b9395bSDavide Caratti "matchCount": "1", 4095b9395bSDavide Caratti "teardown": [ 4195b9395bSDavide Caratti "$TC qdisc del dev $DEV2 ingress" 4295b9395bSDavide Caratti ] 4395b9395bSDavide Caratti }, 4495b9395bSDavide Caratti { 4531c2611bSChris Mi "id": "d052", 4631c2611bSChris Mi "name": "Add 1M filters with the same action", 4731c2611bSChris Mi "category": [ 4831c2611bSChris Mi "filter", 4931c2611bSChris Mi "flower" 5031c2611bSChris Mi ], 51489ce2f4SLucas Bates "plugins": { 52489ce2f4SLucas Bates "requires": "nsPlugin" 53489ce2f4SLucas Bates }, 5431c2611bSChris Mi "setup": [ 5531c2611bSChris Mi "$TC qdisc add dev $DEV2 ingress", 5631c2611bSChris Mi "./tdc_batch.py $DEV2 $BATCH_FILE --share_action -n 1000000" 5731c2611bSChris Mi ], 5831c2611bSChris Mi "cmdUnderTest": "$TC -b $BATCH_FILE", 5931c2611bSChris Mi "expExitCode": "0", 6031c2611bSChris Mi "verifyCmd": "$TC actions list action gact", 6131c2611bSChris Mi "matchPattern": "action order 0: gact action drop.*index 1 ref 1000000 bind 1000000", 6231c2611bSChris Mi "matchCount": "1", 6331c2611bSChris Mi "teardown": [ 6431c2611bSChris Mi "$TC qdisc del dev $DEV2 ingress", 6531c2611bSChris Mi "/bin/rm $BATCH_FILE" 6631c2611bSChris Mi ] 679e35552aSVlad Buslov }, 689e35552aSVlad Buslov { 699e35552aSVlad Buslov "id": "4cbd", 709e35552aSVlad Buslov "name": "Try to add filter with duplicate key", 719e35552aSVlad Buslov "category": [ 729e35552aSVlad Buslov "filter", 739e35552aSVlad Buslov "flower" 749e35552aSVlad Buslov ], 75489ce2f4SLucas Bates "plugins": { 76489ce2f4SLucas Bates "requires": "nsPlugin" 77489ce2f4SLucas Bates }, 789e35552aSVlad Buslov "setup": [ 799e35552aSVlad Buslov "$TC qdisc add dev $DEV2 ingress", 800531b035SVlad Buslov "$TC filter add dev $DEV2 protocol ip prio 1 ingress flower dst_mac e4:11:22:11:4a:51 src_mac e4:11:22:11:4a:50 ip_proto tcp src_ip 1.1.1.1 dst_ip 2.2.2.2 action drop" 819e35552aSVlad Buslov ], 820531b035SVlad Buslov "cmdUnderTest": "$TC filter add dev $DEV2 protocol ip prio 1 ingress flower dst_mac e4:11:22:11:4a:51 src_mac e4:11:22:11:4a:50 ip_proto tcp src_ip 1.1.1.1 dst_ip 2.2.2.2 action drop", 839e35552aSVlad Buslov "expExitCode": "2", 849e35552aSVlad Buslov "verifyCmd": "$TC -s filter show dev $DEV2 ingress", 859e35552aSVlad Buslov "matchPattern": "filter protocol ip pref 1 flower chain 0 handle", 869e35552aSVlad Buslov "matchCount": "1", 879e35552aSVlad Buslov "teardown": [ 889e35552aSVlad Buslov "$TC qdisc del dev $DEV2 ingress" 899e35552aSVlad Buslov ] 90e7534fd4SVlad Buslov }, 91e7534fd4SVlad Buslov { 92e7534fd4SVlad Buslov "id": "7c65", 93e7534fd4SVlad Buslov "name": "Add flower filter and then terse dump it", 94e7534fd4SVlad Buslov "category": [ 95e7534fd4SVlad Buslov "filter", 96e7534fd4SVlad Buslov "flower" 97e7534fd4SVlad Buslov ], 98e7534fd4SVlad Buslov "setup": [ 99e7534fd4SVlad Buslov "$TC qdisc add dev $DEV2 ingress" 100e7534fd4SVlad Buslov ], 101e7534fd4SVlad Buslov "cmdUnderTest": "$TC filter add dev $DEV2 protocol ip pref 1 ingress flower dst_mac e4:11:22:11:4a:51 action drop", 102e7534fd4SVlad Buslov "expExitCode": "0", 10397adb13dSVlad Buslov "verifyCmd": "$TC -br filter show dev $DEV2 ingress", 104e7534fd4SVlad Buslov "matchPattern": "filter protocol ip pref 1 flower.*handle", 105e7534fd4SVlad Buslov "matchCount": "1", 106e7534fd4SVlad Buslov "teardown": [ 107e7534fd4SVlad Buslov "$TC qdisc del dev $DEV2 ingress" 108e7534fd4SVlad Buslov ] 109e7534fd4SVlad Buslov }, 110e7534fd4SVlad Buslov { 111e7534fd4SVlad Buslov "id": "d45e", 112e7534fd4SVlad Buslov "name": "Add flower filter and verify that terse dump doesn't output filter key", 113e7534fd4SVlad Buslov "category": [ 114e7534fd4SVlad Buslov "filter", 115e7534fd4SVlad Buslov "flower" 116e7534fd4SVlad Buslov ], 117e7534fd4SVlad Buslov "setup": [ 118e7534fd4SVlad Buslov "$TC qdisc add dev $DEV2 ingress" 119e7534fd4SVlad Buslov ], 120e7534fd4SVlad Buslov "cmdUnderTest": "$TC filter add dev $DEV2 protocol ip pref 1 ingress flower dst_mac e4:11:22:11:4a:51 action drop", 121e7534fd4SVlad Buslov "expExitCode": "0", 12297adb13dSVlad Buslov "verifyCmd": "$TC -br filter show dev $DEV2 ingress", 123e7534fd4SVlad Buslov "matchPattern": " dst_mac e4:11:22:11:4a:51", 124e7534fd4SVlad Buslov "matchCount": "0", 125e7534fd4SVlad Buslov "teardown": [ 126e7534fd4SVlad Buslov "$TC qdisc del dev $DEV2 ingress" 127e7534fd4SVlad Buslov ] 12876b903eeSLucas Bates } 12976b903eeSLucas Bates] 130