mirror of
https://github.com/torvalds/linux.git
synced 2026-09-14 16:10:02 +02:00
selftests: tc-testing: test action batch failure cleanup
Add tests for cleanup after a batched RTM_NEWACTION request fails. Replace an existing gact action bound to a filter, then fail a later entry by requesting goto chain without a classifier context. Check that the bound action's reference count returns to its original value. Also cover a successfully initialized new action between the bound action and the failing entry, verifying that its reserved index can be reused. Repeat the bound action in another batch to check that each temporary reference to the same action is released. Signed-off-by: Xuanqiang Luo <luoxuanqiang@kylinos.cn> Reviewed-by: Jamal Hadi Salim <jhs@mojatatu.com> Link: https://patch.msgid.link/20260909070336.32979-3-xuanqiang.luo@linux.dev Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
478eb5abb5
commit
2a86bbed9f
|
|
@ -0,0 +1,78 @@
|
|||
[
|
||||
{
|
||||
"id": "e3b1",
|
||||
"name": "Failed action batch releases a bound action reference",
|
||||
"category": [
|
||||
"actions",
|
||||
"gact"
|
||||
],
|
||||
"plugins": {
|
||||
"requires": "nsPlugin"
|
||||
},
|
||||
"setup": [
|
||||
"$TC qdisc add dev $DEV1 ingress",
|
||||
"$TC actions add action pass index 1",
|
||||
"$TC filter add dev $DEV1 protocol all ingress prio 1 matchall action gact index 1"
|
||||
],
|
||||
"cmdUnderTest": "$TC actions replace action pass index 1 action goto chain 42 index 3",
|
||||
"expExitCode": "255",
|
||||
"verifyCmd": "$TC actions ls action gact",
|
||||
"matchPattern": "total acts 1.*index 1 ref 2 bind 1",
|
||||
"matchCount": "1",
|
||||
"teardown": [
|
||||
"$TC qdisc del dev $DEV1 ingress"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "e3b2",
|
||||
"name": "Failed action batch releases entries after a bound action",
|
||||
"category": [
|
||||
"actions",
|
||||
"gact"
|
||||
],
|
||||
"plugins": {
|
||||
"requires": "nsPlugin"
|
||||
},
|
||||
"setup": [
|
||||
"$TC qdisc add dev $DEV1 ingress",
|
||||
"$TC actions add action pass index 1",
|
||||
"$TC filter add dev $DEV1 protocol all ingress prio 1 matchall action gact index 1",
|
||||
[
|
||||
"$TC actions replace action pass index 1 action pass index 2 action goto chain 42 index 3",
|
||||
255
|
||||
]
|
||||
],
|
||||
"cmdUnderTest": "$TC actions add action pass index 2",
|
||||
"expExitCode": "0",
|
||||
"verifyCmd": "$TC actions ls action gact",
|
||||
"matchPattern": "total acts 2.*index 1 ref 2 bind 1.*index 2 ref 1 bind 0",
|
||||
"matchCount": "1",
|
||||
"teardown": [
|
||||
"$TC qdisc del dev $DEV1 ingress"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "e3b3",
|
||||
"name": "Failed action batch releases repeated references to a bound action",
|
||||
"category": [
|
||||
"actions",
|
||||
"gact"
|
||||
],
|
||||
"plugins": {
|
||||
"requires": "nsPlugin"
|
||||
},
|
||||
"setup": [
|
||||
"$TC qdisc add dev $DEV1 ingress",
|
||||
"$TC actions add action pass index 1",
|
||||
"$TC filter add dev $DEV1 protocol all ingress prio 1 matchall action gact index 1"
|
||||
],
|
||||
"cmdUnderTest": "$TC actions replace action pass index 1 action pass index 1 action goto chain 42 index 3",
|
||||
"expExitCode": "255",
|
||||
"verifyCmd": "$TC actions ls action gact",
|
||||
"matchPattern": "total acts 1.*index 1 ref 2 bind 1",
|
||||
"matchCount": "1",
|
||||
"teardown": [
|
||||
"$TC qdisc del dev $DEV1 ingress"
|
||||
]
|
||||
}
|
||||
]
|
||||
Loading…
Reference in New Issue
Block a user