Whamcloud - gitweb
LU-5932 tests: load sunrpc module before insmod ptlrpc_gss 17/13017/3
authorJian Yu <jian.yu@intel.com>
Fri, 12 Dec 2014 08:03:18 +0000 (00:03 -0800)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 15 Jan 2015 04:45:01 +0000 (04:45 +0000)
Lustre ptlrpc_gss module depends on Linux kernel sunrpc module.
This patch fixes load_module() in test-framework.sh to load the
sunrpc module before loading ptlrpc_gss module by using insmod.

This patch is back-ported from the following one:
Lustre-commit: 92479eca2ed5e1871b2660af280917e4d61bdba8
Lustre-change: http://review.whamcloud.com/12790

Signed-off-by: Jian Yu <jian.yu@intel.com>
Change-Id: I105608d37c5889def0fab938a249c2f2a8f2186f
Reviewed-on: http://review.whamcloud.com/13017
Tested-by: Jenkins
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Wei Liu <wei3.liu@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/tests/test-framework.sh

index f51f8e8..2eba34a 100644 (file)
@@ -406,22 +406,24 @@ load_module() {
 
     [ $# -gt 0 ] && echo "${module} options: '$*'"
 
-    # Note that insmod will ignore anything in modprobe.conf, which is why we're
-    # passing options on the command-line.
-    if [ "$BASE" == "lnet_selftest" ] && \
-            [ -f ${LUSTRE}/../lnet/selftest/${module}${EXT} ]; then
-        insmod ${LUSTRE}/../lnet/selftest/${module}${EXT}
-    elif [ -f ${LUSTRE}/${module}${EXT} ]; then
-        insmod ${LUSTRE}/${module}${EXT} "$@"
-    else
-        # must be testing a "make install" or "rpm" installation
-        # note failed to load ptlrpc_gss is considered not fatal
-        if [ "$BASE" == "ptlrpc_gss" ]; then
-            modprobe $BASE "$@" 2>/dev/null || echo "gss/krb5 is not supported"
-        else
-            modprobe $BASE "$@"
-        fi
-    fi
+       # Note that insmod will ignore anything in modprobe.conf, which is why
+       # we're passing options on the command-line.
+       if [[ "$BASE" == "lnet_selftest" ]] &&
+               [[ -f ${LUSTRE}/../lnet/selftest/${module}${EXT} ]]; then
+               insmod ${LUSTRE}/../lnet/selftest/${module}${EXT}
+       elif [[ -f ${LUSTRE}/${module}${EXT} ]]; then
+               [[ "$BASE" != "ptlrpc_gss" ]] || modprobe sunrpc
+               insmod ${LUSTRE}/${module}${EXT} "$@"
+       else
+               # must be testing a "make install" or "rpm" installation
+               # note failed to load ptlrpc_gss is considered not fatal
+               if [[ "$BASE" == "ptlrpc_gss" ]]; then
+                       modprobe $BASE "$@" 2>/dev/null ||
+                               echo "gss/krb5 is not supported"
+               else
+                       modprobe $BASE "$@"
+               fi
+       fi
 }
 
 llite_lloop_enabled() {