selftests: forwarding: lib: Move smcrouted helpers here
authorPetr Machata <petrm@nvidia.com>
Mon, 16 Jun 2025 22:44:20 +0000 (00:44 +0200)
committerJakub Kicinski <kuba@kernel.org>
Wed, 18 Jun 2025 01:18:46 +0000 (18:18 -0700)
commit2a719b7bacc74be9f04147be01262b6289ad8dc5
tree0a7c545e10a19c011865ba6868f1657762da74ab
parentf8337efa4ff5a27e6c1d4e384166413eecd21a65
selftests: forwarding: lib: Move smcrouted helpers here

router_multicast.sh has several helpers for work with smcrouted. Extract
them to lib.sh so that other selftests can use them as well. Convert the
helpers to defer in the process, because that simplifies the interface
quite a bit. Therefore have router_multicast.sh invoke
defer_scopes_cleanup() in its cleanup() function.

Signed-off-by: Petr Machata <petrm@nvidia.com>
Link: https://patch.msgid.link/410411c1a81225ce6e44542289b9c3ec21e5786c.1750113335.git.petrm@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/net/forwarding/lib.sh
tools/testing/selftests/net/forwarding/router_multicast.sh