Skip to content

Commit

Permalink
selftests: net: use upstream mtools
Browse files Browse the repository at this point in the history
Joachim kindly merged the IPv6 support in
https://github.com/troglobit/mtools/pull/2, so we can just use his
version now. A few more fixes subsequently came in for IPv6, so even
better.

Check that the deployed mtools version is 3.0 or above. Note that the
version check breaks compatibility with my fork where I didn't bump the
version, but I assume that won't be a problem.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Link: https://lore.kernel.org/r/20240510112856.1262901-1-vladimir.oltean@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Vladimir Oltean authored and Jakub Kicinski committed May 13, 2024
1 parent f37dc28 commit cfc2eef
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions tools/testing/selftests/net/forwarding/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -309,17 +309,32 @@ require_command()
fi
}

# IPv6 support was added in v3.0
check_mtools_version()
{
local version="$(msend -v)"
local major

version=${version##msend version }
major=$(echo $version | cut -d. -f1)

if [ $major -lt 3 ]; then
echo "SKIP: expected mtools version 3.0, got $version"
exit $ksft_skip
fi
}

if [[ "$REQUIRE_JQ" = "yes" ]]; then
require_command jq
fi
if [[ "$REQUIRE_MZ" = "yes" ]]; then
require_command $MZ
fi
if [[ "$REQUIRE_MTOOLS" = "yes" ]]; then
# https://github.com/vladimiroltean/mtools/
# patched for IPv6 support
# https://github.com/troglobit/mtools
require_command msend
require_command mreceive
check_mtools_version
fi

##############################################################################
Expand Down

0 comments on commit cfc2eef

Please sign in to comment.