init_test_env $@
. ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
-load_llog_test() {
- grep -q llog_test /proc/modules && return
- # Module should have been placed with other lustre modules...
- modprobe llog_test 2>&1 | grep -v "llog_test not found"
- grep -q llog_test /proc/modules && return
- # But maybe we're running from a developer tree...
- insmod $LUSTRE/obdclass/llog_test.ko
- grep -q llog_test /proc/modules && return
- echo "Unable to load llog_test module!"
- false
- return
-}
-
PATH=$(dirname $0):$LUSTRE/utils:$PATH
TMP=${TMP:-/tmp}
MGS=$($LCTL dl | awk '/mgs/ { print $4 }')
[ -z "$MGS" ] && echo "$0: SKIP: no MGS available, skipping llog test" && exit 0
-load_llog_test || exit 0
+load_module obdclass/llog_test || exit 0
$LCTL modules > $TMP/ogdb-$(hostname)
echo "NOW reload debugging syms.."
local rc=0
local rmmod_remote=0
- do_facet ost1 "lsmod | grep -q obdecho || " \
- "{ insmod ${LUSTRE}/obdecho/obdecho.ko || " \
- "modprobe obdecho; }" && rmmod_remote=1
+ do_rpc_nodes $(facet_active_host ost1) load_module obdecho/obdecho &&
+ rmmod_remote=true || error "failed to load module obdecho"
target=$(do_facet ost1 $LCTL dl | awk '/obdfilter/ {print $4;exit}')
[[ -n $target ]] && { obdecho_test $target ost1 || rc=1; }
- [ $rmmod_remote -eq 1 ] && do_facet ost1 "rmmod obdecho"
+ $rmmod_remote && do_facet ost1 "rmmod obdecho"
return $rc
}
run_test 180b "test obdecho directly on obdfilter"
/sbin/lsmod | grep -q "^\<$1\>"
}
+PRLFS=false
+lustre_insmod() {
+ local module=$1
+ shift
+ local args="$@"
+ local msg
+ local rc=0
+
+ if ! $PRLFS; then
+ msg="$(insmod $module $args 2>&1)" && return 0 || rc=$?
+ fi
+
+ # parallels can't load modules directly from prlfs, use /tmp instead
+ if $PRLFS || [[ "$(stat -f -c%t $module)" == "7c7c6673" ]]; then
+ local target="$(mktemp)"
+
+ cp "$module" "$target"
+ insmod $target $args
+ rc=$?
+ [[ $rc == 0 ]] && PRLFS=true
+ rm -f $target
+ else
+ echo "$msg"
+ fi
+ return $rc
+}
+
# Load a module on the system where this is running.
#
# usage: load_module module_name [module arguments for insmod/modprobe]
# 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}
+ lustre_insmod ${LUSTRE}/../lnet/selftest/${module}${EXT}
elif [[ -f ${LUSTRE}/${module}${EXT} ]]; then
[[ "$BASE" != "ptlrpc_gss" ]] || modprobe sunrpc
- insmod ${LUSTRE}/${module}${EXT} "$@"
+ lustre_insmod ${LUSTRE}/${module}${EXT} "$@"
else
# must be testing a "make install" or "rpm" installation
# note failed to load ptlrpc_gss is considered not fatal