From a11aab73e88b83192d60b54f957be71f36e7a20f Mon Sep 17 00:00:00 2001 From: Michal Berger Date: Thu, 6 Feb 2020 16:26:58 +0100 Subject: [PATCH] test/common: Check if igb_uio is loaded before removing it igb_uio doesn't necessarily have to be loaded into the kernel as SDPK still may be built with support for it but only particular set of tests is actually using it. If such a condition is met then rmmod will fail the entire test run since it always exits with != 0 if given module is not found. Avoid this by checking first if igb_uio is actually in use. Change-Id: Ib97488797c657f810b588a0b427e578807ebe6c6 Signed-off-by: Michal Berger Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/625 Tested-by: SPDK CI Jenkins Reviewed-by: Jim Harris Reviewed-by: Shuhei Matsumoto Reviewed-by: Ben Walker Community-CI: SPDK CI Jenkins --- test/common/autotest_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/common/autotest_common.sh b/test/common/autotest_common.sh index b77796400..69793f092 100644 --- a/test/common/autotest_common.sh +++ b/test/common/autotest_common.sh @@ -1000,7 +1000,7 @@ function autotest_cleanup() $rootdir/scripts/setup.sh cleanup if [ $(uname -s) = "Linux" ]; then if grep -q '#define SPDK_CONFIG_IGB_UIO_DRIVER 1' $rootdir/include/spdk/config.h; then - rmmod igb_uio + [[ -e /sys/module/igb_uio ]] && rmmod igb_uio else modprobe -r uio_pci_generic fi