Commit 3099c59d authored by Florian Westphal's avatar Florian Westphal Committed by David S. Miller

selftests: rtnetlink: skip ipsec offload tests if netdevsim isn't present

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: default avatarFlorian Westphal <fw@strlen.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fc413885
...@@ -738,13 +738,17 @@ kci_test_ipsec_offload() ...@@ -738,13 +738,17 @@ kci_test_ipsec_offload()
sysfsd=/sys/kernel/debug/netdevsim/netdevsim0/ports/0/ sysfsd=/sys/kernel/debug/netdevsim/netdevsim0/ports/0/
sysfsf=$sysfsd/ipsec sysfsf=$sysfsd/ipsec
sysfsnet=/sys/bus/netdevsim/devices/netdevsim0/net/ sysfsnet=/sys/bus/netdevsim/devices/netdevsim0/net/
probed=false
# setup netdevsim since dummydev doesn't have offload support # setup netdevsim since dummydev doesn't have offload support
modprobe netdevsim if [ ! -w /sys/bus/netdevsim/new_device ] ; then
check_err $? modprobe -q netdevsim
if [ $ret -ne 0 ]; then check_err $?
echo "FAIL: ipsec_offload can't load netdevsim" if [ $ret -ne 0 ]; then
return 1 echo "SKIP: ipsec_offload can't load netdevsim"
return $ksft_skip
fi
probed=true
fi fi
echo "0" > /sys/bus/netdevsim/new_device echo "0" > /sys/bus/netdevsim/new_device
...@@ -824,7 +828,7 @@ EOF ...@@ -824,7 +828,7 @@ EOF
fi fi
# clean up any leftovers # clean up any leftovers
rmmod netdevsim $probed && rmmod netdevsim
if [ $ret -ne 0 ]; then if [ $ret -ne 0 ]; then
echo "FAIL: ipsec_offload" echo "FAIL: ipsec_offload"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment