diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh
index 54807b45bad2d91a7a9be8c3531cc4fb77dab473..9143f9946e2c005dc70dd84411965f7158a87f12 100644
--- a/lustre/tests/test-framework.sh
+++ b/lustre/tests/test-framework.sh
@@ -217,7 +217,7 @@ unload_modules() {
     wait_exit_ST client # bug 12845
 
     lsmod | grep libcfs > /dev/null && $LCTL dl
-    local MODULES=$($LCTL modules | awk '{ print $2 }' | grep -v libcfs)
+    local MODULES=$($LCTL modules | awk '{ print $2 }' | grep -v libcfs) || true
     $RMMOD $MODULES > /dev/null 2>&1 || true
      # do it again, in case we tried to unload ksocklnd too early
     MODULES=$($LCTL modules | awk '{ print $2 }' | grep -v libcfs) || true