Skip to content

Commit 818481d

Browse files
apconolekuba-moo
authored andcommitted
selftests: openvswitch: Attempt to autoload module.
Previously, the openvswitch.sh test suites would not attempt to autoload the openvswitch module. The idea was that a user who is manually running tests might not even have the OVS module loaded or configured for their own development. However, if the kernel module is configured, and the module can be autoloaded then we should just attempt to load it and run the tests. This is especially true in the CI environments, where the CI tests should be able to rely on auto loading to get the test suite running. Signed-off-by: Aaron Conole <[email protected]> Reviewed-by: Simon Horman <[email protected]> Tested-by: Simon Horman <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent ff01570 commit 818481d

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

tools/testing/selftests/net/openvswitch/openvswitch.sh

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -613,16 +613,20 @@ run_test() {
613613
tname="$1"
614614
tdesc="$2"
615615

616-
if ! lsmod | grep openvswitch >/dev/null 2>&1; then
617-
stdbuf -o0 printf "TEST: %-60s [NOMOD]\n" "${tdesc}"
618-
return $ksft_skip
619-
fi
620-
621616
if python3 ovs-dpctl.py -h 2>&1 | \
622617
grep -E "Need to (install|upgrade) the python" >/dev/null 2>&1; then
623618
stdbuf -o0 printf "TEST: %-60s [PYLIB]\n" "${tdesc}"
624619
return $ksft_skip
625620
fi
621+
622+
python3 ovs-dpctl.py show >/dev/null 2>&1 || \
623+
echo "[DPCTL] show exception."
624+
625+
if ! lsmod | grep openvswitch >/dev/null 2>&1; then
626+
stdbuf -o0 printf "TEST: %-60s [NOMOD]\n" "${tdesc}"
627+
return $ksft_skip
628+
fi
629+
626630
printf "TEST: %-60s [START]\n" "${tname}"
627631

628632
unset IFS

0 commit comments

Comments
 (0)