Skip to content

Commit

Permalink
selftests: rtnetlink: skip ipsec offload tests if netdevsim isn't pre…
Browse files Browse the repository at this point in the history
…sent

running the script on systems without netdevsim now prints:

SKIP: ipsec_offload can't load netdevsim

instead of error message & failed status.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Florian Westphal authored and David S. Miller committed Jun 29, 2019
1 parent fc41388 commit 3099c59
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions tools/testing/selftests/net/rtnetlink.sh
Original file line number Diff line number Diff line change
Expand Up @@ -738,13 +738,17 @@ kci_test_ipsec_offload()
sysfsd=/sys/kernel/debug/netdevsim/netdevsim0/ports/0/
sysfsf=$sysfsd/ipsec
sysfsnet=/sys/bus/netdevsim/devices/netdevsim0/net/
probed=false

# setup netdevsim since dummydev doesn't have offload support
modprobe netdevsim
check_err $?
if [ $ret -ne 0 ]; then
echo "FAIL: ipsec_offload can't load netdevsim"
return 1
if [ ! -w /sys/bus/netdevsim/new_device ] ; then
modprobe -q netdevsim
check_err $?
if [ $ret -ne 0 ]; then
echo "SKIP: ipsec_offload can't load netdevsim"
return $ksft_skip
fi
probed=true
fi

echo "0" > /sys/bus/netdevsim/new_device
Expand Down Expand Up @@ -824,7 +828,7 @@ EOF
fi

# clean up any leftovers
rmmod netdevsim
$probed && rmmod netdevsim

if [ $ret -ne 0 ]; then
echo "FAIL: ipsec_offload"
Expand Down

0 comments on commit 3099c59

Please sign in to comment.