selftest: fix flower terse dump tests
[linux-2.6-microblaze.git] / tools / testing / selftests / tc-testing / tc-tests / filters / tests.json
1 [
2     {
3         "id": "2638",
4         "name": "Add matchall and try to get it",
5         "category": [
6             "filter",
7             "matchall"
8         ],
9         "plugins": {
10                 "requires": "nsPlugin"
11         },
12         "setup": [
13             "$TC qdisc add dev $DEV1 clsact",
14             "$TC filter add dev $DEV1 protocol all pref 1 ingress handle 0x1234 matchall action ok"
15         ],
16         "cmdUnderTest": "$TC filter get dev $DEV1 protocol all pref 1 ingress handle 0x1234 matchall",
17         "expExitCode": "0",
18         "verifyCmd": "$TC filter show dev $DEV1 ingress",
19         "matchPattern": "filter protocol all pref 1 matchall chain 0 handle 0x1234",
20         "matchCount": "1",
21         "teardown": [
22             "$TC qdisc del dev $DEV1 clsact"
23         ]
24     },
25     {
26         "id": "2ff3",
27         "name": "Add flower with max handle and then dump it",
28         "category": [
29             "filter",
30             "flower"
31         ],
32         "setup": [
33             "$TC qdisc add dev $DEV2 ingress"
34         ],
35         "cmdUnderTest": "$TC filter add dev $DEV2 protocol ip pref 1 ingress handle 0xffffffff flower action ok",
36         "expExitCode": "0",
37         "verifyCmd": "$TC filter show dev $DEV2 ingress",
38         "matchPattern": "filter protocol ip pref 1 flower.*handle 0xffffffff",
39         "matchCount": "1",
40         "teardown": [
41             "$TC qdisc del dev $DEV2 ingress"
42         ]
43     },
44     {
45         "id": "d052",
46         "name": "Add 1M filters with the same action",
47         "category": [
48             "filter",
49             "flower"
50         ],
51         "plugins": {
52                 "requires": "nsPlugin"
53         },
54         "setup": [
55             "$TC qdisc add dev $DEV2 ingress",
56             "./tdc_batch.py $DEV2 $BATCH_FILE --share_action -n 1000000"
57         ],
58         "cmdUnderTest": "$TC -b $BATCH_FILE",
59         "expExitCode": "0",
60         "verifyCmd": "$TC actions list action gact",
61         "matchPattern": "action order 0: gact action drop.*index 1 ref 1000000 bind 1000000",
62         "matchCount": "1",
63         "teardown": [
64             "$TC qdisc del dev $DEV2 ingress",
65             "/bin/rm $BATCH_FILE"
66         ]
67     },
68     {
69         "id": "4cbd",
70         "name": "Try to add filter with duplicate key",
71         "category": [
72             "filter",
73             "flower"
74         ],
75         "plugins": {
76                 "requires": "nsPlugin"
77         },
78         "setup": [
79             "$TC qdisc add dev $DEV2 ingress",
80             "$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"
81         ],
82         "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",
83         "expExitCode": "2",
84         "verifyCmd": "$TC -s filter show dev $DEV2 ingress",
85         "matchPattern": "filter protocol ip pref 1 flower chain 0 handle",
86         "matchCount": "1",
87         "teardown": [
88             "$TC qdisc del dev $DEV2 ingress"
89         ]
90     },
91     {
92         "id": "7c65",
93         "name": "Add flower filter and then terse dump it",
94         "category": [
95             "filter",
96             "flower"
97         ],
98         "setup": [
99             "$TC qdisc add dev $DEV2 ingress"
100         ],
101         "cmdUnderTest": "$TC filter add dev $DEV2 protocol ip pref 1 ingress flower dst_mac e4:11:22:11:4a:51 action drop",
102         "expExitCode": "0",
103         "verifyCmd": "$TC -br filter show dev $DEV2 ingress",
104         "matchPattern": "filter protocol ip pref 1 flower.*handle",
105         "matchCount": "1",
106         "teardown": [
107             "$TC qdisc del dev $DEV2 ingress"
108         ]
109     },
110     {
111         "id": "d45e",
112         "name": "Add flower filter and verify that terse dump doesn't output filter key",
113         "category": [
114             "filter",
115             "flower"
116         ],
117         "setup": [
118             "$TC qdisc add dev $DEV2 ingress"
119         ],
120         "cmdUnderTest": "$TC filter add dev $DEV2 protocol ip pref 1 ingress flower dst_mac e4:11:22:11:4a:51 action drop",
121         "expExitCode": "0",
122         "verifyCmd": "$TC -br filter show dev $DEV2 ingress",
123         "matchPattern": "  dst_mac e4:11:22:11:4a:51",
124         "matchCount": "0",
125         "teardown": [
126             "$TC qdisc del dev $DEV2 ingress"
127         ]
128     }
129 ]