Skip to content

Commit 0fbb5a5

Browse files
tammelakuba-moo
authored andcommitted
selftests: tc-testing: remove filters/tests.json
Remove this generic file and move the tests to their appropriate files Signed-off-by: Pedro Tammela <[email protected]> Acked-by: Jamal Hadi Salim <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 7de8b2e commit 0fbb5a5

File tree

3 files changed

+121
-123
lines changed

3 files changed

+121
-123
lines changed

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

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,5 +173,103 @@
173173
"$TC qdisc del dev $DEV2 ingress",
174174
"/bin/rm -rf $BATCH_DIR"
175175
]
176+
},
177+
{
178+
"id": "2ff3",
179+
"name": "Add flower with max handle and then dump it",
180+
"category": [
181+
"filter",
182+
"flower"
183+
],
184+
"setup": [
185+
"$TC qdisc add dev $DEV2 ingress"
186+
],
187+
"cmdUnderTest": "$TC filter add dev $DEV2 protocol ip pref 1 ingress handle 0xffffffff flower action ok",
188+
"expExitCode": "0",
189+
"verifyCmd": "$TC filter show dev $DEV2 ingress",
190+
"matchPattern": "filter protocol ip pref 1 flower.*handle 0xffffffff",
191+
"matchCount": "1",
192+
"teardown": [
193+
"$TC qdisc del dev $DEV2 ingress"
194+
]
195+
},
196+
{
197+
"id": "d052",
198+
"name": "Add 1M filters with the same action",
199+
"category": [
200+
"filter",
201+
"flower"
202+
],
203+
"setup": [
204+
"$TC qdisc add dev $DEV2 ingress",
205+
"./tdc_batch.py $DEV2 $BATCH_FILE --share_action -n 1000000"
206+
],
207+
"cmdUnderTest": "$TC -b $BATCH_FILE",
208+
"expExitCode": "0",
209+
"verifyCmd": "$TC actions list action gact",
210+
"matchPattern": "action order 0: gact action drop.*index 1 ref 1000000 bind 1000000",
211+
"matchCount": "1",
212+
"teardown": [
213+
"$TC qdisc del dev $DEV2 ingress",
214+
"/bin/rm $BATCH_FILE"
215+
]
216+
},
217+
{
218+
"id": "4cbd",
219+
"name": "Try to add filter with duplicate key",
220+
"category": [
221+
"filter",
222+
"flower"
223+
],
224+
"setup": [
225+
"$TC qdisc add dev $DEV2 ingress",
226+
"$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"
227+
],
228+
"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",
229+
"expExitCode": "2",
230+
"verifyCmd": "$TC -s filter show dev $DEV2 ingress",
231+
"matchPattern": "filter protocol ip pref 1 flower chain 0 handle",
232+
"matchCount": "1",
233+
"teardown": [
234+
"$TC qdisc del dev $DEV2 ingress"
235+
]
236+
},
237+
{
238+
"id": "7c65",
239+
"name": "Add flower filter and then terse dump it",
240+
"category": [
241+
"filter",
242+
"flower"
243+
],
244+
"setup": [
245+
"$TC qdisc add dev $DEV2 ingress"
246+
],
247+
"cmdUnderTest": "$TC filter add dev $DEV2 protocol ip pref 1 ingress flower dst_mac e4:11:22:11:4a:51 action drop",
248+
"expExitCode": "0",
249+
"verifyCmd": "$TC -br filter show dev $DEV2 ingress",
250+
"matchPattern": "filter protocol ip pref 1 flower.*handle",
251+
"matchCount": "1",
252+
"teardown": [
253+
"$TC qdisc del dev $DEV2 ingress"
254+
]
255+
},
256+
{
257+
"id": "d45e",
258+
"name": "Add flower filter and verify that terse dump doesn't output filter key",
259+
"category": [
260+
"filter",
261+
"flower"
262+
],
263+
"setup": [
264+
"$TC qdisc add dev $DEV2 ingress"
265+
],
266+
"cmdUnderTest": "$TC filter add dev $DEV2 protocol ip pref 1 ingress flower dst_mac e4:11:22:11:4a:51 action drop",
267+
"expExitCode": "0",
268+
"verifyCmd": "$TC -br filter show dev $DEV2 ingress",
269+
"matchPattern": " dst_mac e4:11:22:11:4a:51",
270+
"matchCount": "0",
271+
"teardown": [
272+
"$TC qdisc del dev $DEV2 ingress"
273+
]
176274
}
177275
]

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

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,5 +480,28 @@
480480
"$TC qdisc del dev $DUMMY ingress",
481481
"$TC actions del action police index 199"
482482
]
483+
},
484+
{
485+
"id": "2638",
486+
"name": "Add matchall and try to get it",
487+
"category": [
488+
"filter",
489+
"matchall"
490+
],
491+
"plugins": {
492+
"requires": "nsPlugin"
493+
},
494+
"setup": [
495+
"$TC qdisc add dev $DEV1 clsact",
496+
"$TC filter add dev $DEV1 protocol all pref 1 ingress handle 0x1234 matchall action ok"
497+
],
498+
"cmdUnderTest": "$TC filter get dev $DEV1 protocol all pref 1 ingress handle 0x1234 matchall",
499+
"expExitCode": "0",
500+
"verifyCmd": "$TC filter show dev $DEV1 ingress",
501+
"matchPattern": "filter protocol all pref 1 matchall chain 0 handle 0x1234",
502+
"matchCount": "1",
503+
"teardown": [
504+
"$TC qdisc del dev $DEV1 clsact"
505+
]
483506
}
484507
]

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

Lines changed: 0 additions & 123 deletions
This file was deleted.

0 commit comments

Comments
 (0)