]> www.infradead.org Git - users/hch/misc.git/commit
selftests: forwarding: lib: Move require_command to net, generalize
authorPetr Machata <petrm@nvidia.com>
Fri, 14 Feb 2025 16:18:22 +0000 (17:18 +0100)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 18 Feb 2025 12:06:43 +0000 (13:06 +0100)
commitf802f172d78b8b96dcd1832dc7c8da8ee9dcbc29
treefd2224d1a09fac4d6a006f0a1c6558c7e321126b
parentd42d543368343c0449a4e433b5f02e063a86209c
selftests: forwarding: lib: Move require_command to net, generalize

This helper could be useful to more than just forwarding tests.
Move it upstairs and port over to log_test_skip().

Split the function into two parts: the bit that actually checks and
reports skip, which is in a new function check_command(). And a bit
that exits the test script if the check fails. This allows users
consistent checking behavior while giving an option to bail out from
a single test without bailing out of the whole script.

Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Nikolay Aleksandrov <razor@blackwall.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
tools/testing/selftests/net/forwarding/lib.sh
tools/testing/selftests/net/lib.sh