selftests: mlxsw: rtnetlink: Use devlink_reload() API

The test runs "devlink reload" explicitly. Instead, it is better to use
devlink_reload() which waits for udev events to be processed. Do not sleep
after reload, as devlink_reload() blocks until all the netdevs are renamed.

Signed-off-by: Amit Cohen <amcohen@nvidia.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: Petr Machata <petrm@nvidia.com>
Link: https://patch.msgid.link/844509e3057b65277a7181a23c95b71ec95e8a56.1727706741.git.petrm@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Amit Cohen 2024-09-30 17:12:50 +02:00 committed by Jakub Kicinski
parent 25ba2a5ada
commit be4e323544

View File

@ -186,10 +186,7 @@ bridge_vlan_flags_test()
# If we did not handle references correctly, then this should produce a
# trace
devlink dev reload "$DEVLINK_DEV"
# Allow netdevices to be re-created following the reload
sleep 20
devlink_reload
log_test "bridge vlan flags"
}
@ -923,12 +920,9 @@ devlink_reload_test()
# devlink reload can be performed without errors
RET=0
devlink dev reload "$DEVLINK_DEV"
check_err $? "devlink reload failed"
devlink_reload
log_test "devlink reload - last test"
sleep 20
}
trap cleanup EXIT