Skip to content

Commit 47efbac

Browse files
idoschPaolo Abeni
authored andcommitted
selftests: traceroute: Use require_command()
Use require_command() so that the test will return SKIP (4) when a required command is not present. Before: # ./traceroute.sh SKIP: Could not run IPV6 test without traceroute6 SKIP: Could not run IPV4 test without traceroute $ echo $? 0 After: # ./traceroute.sh TEST: traceroute6 not installed [SKIP] $ echo $? 4 Reviewed-by: Petr Machata <[email protected]> Reviewed-by: David Ahern <[email protected]> Signed-off-by: Ido Schimmel <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
1 parent c068ba9 commit 47efbac

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

tools/testing/selftests/net/traceroute.sh

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -181,11 +181,6 @@ setup_traceroute6()
181181

182182
run_traceroute6()
183183
{
184-
if [ ! -x "$(command -v traceroute6)" ]; then
185-
echo "SKIP: Could not run IPV6 test without traceroute6"
186-
return
187-
fi
188-
189184
setup_traceroute6
190185

191186
RET=0
@@ -249,11 +244,6 @@ setup_traceroute()
249244

250245
run_traceroute()
251246
{
252-
if [ ! -x "$(command -v traceroute)" ]; then
253-
echo "SKIP: Could not run IPV4 test without traceroute"
254-
return
255-
fi
256-
257247
setup_traceroute
258248

259249
RET=0
@@ -287,6 +277,9 @@ do
287277
esac
288278
done
289279

280+
require_command traceroute6
281+
require_command traceroute
282+
290283
run_tests
291284

292285
exit "${EXIT_STATUS}"

0 commit comments

Comments
 (0)