summaryrefslogtreecommitdiffstats
path: root/tools/testing
diff options
context:
space:
mode:
authorIdo Schimmel <idosch@nvidia.com>2020-11-23 09:12:26 +0200
committerJakub Kicinski <kuba@kernel.org>2020-11-24 12:14:56 -0800
commit24eb2a02a68c98d46878214f46f855d934dc73ff (patch)
treeead468329a6334fd98372a2208613ff7a73588fd /tools/testing
parent68e92ad855cfa5e9b8db8b875e948b1032dfc2e8 (diff)
selftests: mlxsw: Add blackhole nexthop configuration tests
Test the mlxsw allows blackhole nexthops to be installed and that the nexthops are marked as offloaded. Signed-off-by: Ido Schimmel <idosch@nvidia.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/testing')
-rwxr-xr-xtools/testing/selftests/drivers/net/mlxsw/rtnetlink.sh25
1 files changed, 22 insertions, 3 deletions
diff --git a/tools/testing/selftests/drivers/net/mlxsw/rtnetlink.sh b/tools/testing/selftests/drivers/net/mlxsw/rtnetlink.sh
index 5de47d72f8c9..a2eff5f58209 100755
--- a/tools/testing/selftests/drivers/net/mlxsw/rtnetlink.sh
+++ b/tools/testing/selftests/drivers/net/mlxsw/rtnetlink.sh
@@ -32,6 +32,7 @@ ALL_TESTS="
nexthop_obj_invalid_test
nexthop_obj_offload_test
nexthop_obj_group_offload_test
+ nexthop_obj_blackhole_offload_test
nexthop_obj_route_offload_test
devlink_reload_test
"
@@ -693,9 +694,6 @@ nexthop_obj_invalid_test()
ip nexthop add id 1 encap mpls 200/300 via 192.0.2.3 dev $swp1
check_fail $? "managed to configure a nexthop with MPLS encap when should not"
- ip nexthop add id 1 blackhole
- check_fail $? "managed to configure a blackhole nexthop when should not"
-
ip nexthop add id 1 dev $swp1
ip nexthop add id 2 dev $swp1
ip nexthop add id 10 group 1/2
@@ -817,6 +815,27 @@ nexthop_obj_group_offload_test()
simple_if_fini $swp1 192.0.2.1/24 2001:db8:1::1/64
}
+nexthop_obj_blackhole_offload_test()
+{
+ # Test offload indication of blackhole nexthop objects
+ RET=0
+
+ ip nexthop add id 1 blackhole
+ busywait "$TIMEOUT" wait_for_offload \
+ ip nexthop show id 1
+ check_err $? "Blackhole nexthop not marked as offloaded when should"
+
+ ip nexthop add id 10 group 1
+ busywait "$TIMEOUT" wait_for_offload \
+ ip nexthop show id 10
+ check_err $? "Nexthop group not marked as offloaded when should"
+
+ log_test "blackhole nexthop objects offload indication"
+
+ ip nexthop del id 10
+ ip nexthop del id 1
+}
+
nexthop_obj_route_offload_test()
{
# Test offload indication of routes using nexthop objects