summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorAmit Cohen <amitc@mellanox.com>2019-11-07 19:42:18 +0300
committerDavid S. Miller <davem@davemloft.net>2019-11-08 06:51:40 +0300
commit7ce4e7608674ff4ba78157eea4bea464e4106545 (patch)
tree692953097f9502437b0ce3c02fc6c767163464dc /tools
parentfd74feeb2452c94f6e381e1fcef00d69b55723b8 (diff)
downloadlinux-7ce4e7608674ff4ba78157eea4bea464e4106545.tar.xz
selftests: forwarding: devlink: Add functionality for trap exceptions test
Add common part of all the tests - check devlink status to ensure that packets were trapped. Signed-off-by: Amit Cohen <amitc@mellanox.com> Acked-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools')
-rw-r--r--tools/testing/selftests/net/forwarding/devlink_lib.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/testing/selftests/net/forwarding/devlink_lib.sh b/tools/testing/selftests/net/forwarding/devlink_lib.sh
index cbc38cc61873..40b076983239 100644
--- a/tools/testing/selftests/net/forwarding/devlink_lib.sh
+++ b/tools/testing/selftests/net/forwarding/devlink_lib.sh
@@ -356,6 +356,18 @@ devlink_trap_group_stats_idle_test()
fi
}
+devlink_trap_exception_test()
+{
+ local trap_name=$1; shift
+ local group_name=$1; shift
+
+ devlink_trap_stats_idle_test $trap_name
+ check_fail $? "Trap stats idle when packets should have been trapped"
+
+ devlink_trap_group_stats_idle_test $group_name
+ check_fail $? "Trap group idle when packets should have been trapped"
+}
+
devlink_trap_drop_test()
{
local trap_name=$1; shift