Add two gact cases: binding an action whose goto chain belongs to the block of another qdisc must fail and leave the action untouched, while binding it from a filter of the same block keeps working. The first case fails without the previous patch and passes with it. These tests were written with the help of an AI assistant. Signed-off-by: Muhammad Umer <mume…@gmail.com> --- .../actions/gact-goto-chain-block.json | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 tools/testing/selftests/tc-testing/tc-tests/actions/gact-goto-chain-block.json diff --git a/tools/testing/selftests/tc-testing/tc-tests/actions/gact-goto-chain-block.json b/tools/testing/selftests/tc-testing/tc-tests/actions/gact-goto-chain-block.json new file mode 100644 index 00000000000..147c5200b52 --- /dev/null +++ b/tools/testing/selftests/tc-testing/tc-tests/actions/gact-goto-chain-block.json @@ -0,0 +1,54 @@ +[ + { + "id": "23ab", + "name": "Reject binding an action whose goto chain is in another block", + "category": [ + "actions", + "gact" + ], + "plugins": { + "requires": "nsPlugin" + }, + "setup": [ + "$TC qdisc add dev $DUMMY root handle 1: drr", + "$TC class add dev $DUMMY parent 1: classid 1:1 drr", + "$TC filter add dev $DUMMY parent 1: chain 5 protocol all prio 1 matchall classid 1:1", + "$TC filter add dev $DUMMY parent 1: chain 0 protocol all prio 1 matchall action gact goto chain 5 index 77", + "$TC qdisc add dev $DEV1 root handle 2: htb" + ], + "cmdUnderTest": "$TC filter add dev $DEV1 parent 2: protocol all prio 1 matchall action gact pass index 77", + "expExitCode": "2", + "verifyCmd": "$TC actions get action gact index 77", + "matchPattern": "index 77 ref 1 bind 1", + "matchCount": "1", + "teardown": [ + "$TC qdisc del dev $DEV1 root", + "$TC qdisc del dev $DUMMY root" + ] + }, + { + "id": "8ada", + "name": "Bind an action whose goto chain is in the same block", + "category": [ + "actions", + "gact" + ], + "plugins": { + "requires": "nsPlugin" + }, + "setup": [ + "$TC qdisc add dev $DUMMY root handle 1: drr", + "$TC class add dev $DUMMY parent 1: classid 1:1 drr", + "$TC filter add dev $DUMMY parent 1: chain 5 protocol all prio 1 matchall classid 1:1", + "$TC filter add dev $DUMMY parent 1: chain 0 protocol all prio 1 matchall action gact goto chain 5 index 77" + ], + "cmdUnderTest": "$TC filter add dev $DUMMY parent 1: chain 0 protocol all prio 2 matchall action gact pass index 77", + "expExitCode": "0", + "verifyCmd": "$TC actions get action gact index 77", + "matchPattern": "index 77 ref 2 bind 2", + "matchCount": "1", + "teardown": [ + "$TC qdisc del dev $DUMMY root" + ] + } +]
-- 2.53.0