return 0
}
-load_lnet() {
- load_module ../libcfs/libcfs/libcfs
- # Prevent local MODOPTS_LIBCFS being passed as part of environment
- # variable to remote nodes
- unset MODOPTS_LIBCFS
-
- set_default_debug "neterror net nettrace malloc"
- load_module ../lnet/lnet/lnet "$@"
-
- LNDPATH=${LNDPATH:-"../lnet/klnds"}
- if [ -z "$LNETLND" ]; then
- case $NETTYPE in
- o2ib*) LNETLND="o2iblnd/ko2iblnd" ;;
- tcp*) LNETLND="socklnd/ksocklnd" ;;
- *) local lnd="${NETTYPE%%[0-9]}lnd"
- [ -f "$LNDPATH/$lnd/k$lnd.ko" ] &&
- LNETLND="$lnd/k$lnd" ||
- LNETLND="socklnd/ksocklnd"
- esac
- fi
- load_module ../lnet/klnds/$LNETLND
-}
-
-do_lnetctl() {
- $LCTL mark "$LNETCTL $*"
- echo "$LNETCTL $*"
- $LNETCTL "$@"
-}
-
TESTNS='test_ns'
FAKE_IF="test1pg"
FAKE_IP="10.1.2.3"
setup_netns || error "setup_netns failed with $?"
# Determine the local interface(s) used for LNet
-load_modules || error "Failed to load modules"
+load_lnet "config_on_load=1" || error "Failed to load modules"
do_lnetctl net show
ip a
# Loading modules should configure LNet with the appropriate
# test-framework configuration
- load_modules || error "Failed to load modules"
+ load_lnet "config_on_load=1" || error "Failed to load modules"
LNIDS=( $($LCTL list_nids | xargs echo) )
RNIDS=( $(do_node $RNODE $LCTL list_nids | xargs echo) )
if [[ -z ${RNIDS[@]} ]]; then
- do_rpc_nodes $RNODE load_modules_local
+ do_rpc_nodes $RNODE load_lnet "config_on_load=1"
RLOADED=true
RNIDS=( $(do_node $RNODE $LCTL list_nids | xargs echo) )
fi
# Loading modules should configure LNet with the appropriate
# test-framework configuration
- load_modules || error "Failed to load modules"
+ load_lnet "config_on_load=1" || error "Failed to load modules"
local my_nid=$($LCTL list_nids | head -n 1)
[[ -z $my_nid ]] &&
local rloaded=false
if [[ -z $rnodenids ]]; then
- do_rpc_nodes $rnode load_modules_local
+ do_rpc_nodes $rnode load_lnet "config_on_load=1"
rloaded=true
rnodenids=$(do_node $rnode $LCTL list_nids | xargs echo)
fi
fi
}
-load_modules_local() {
- if [ -n "$MODPROBE" ]; then
- # use modprobe
- echo "Using modprobe to load modules"
- return 0
- fi
-
- # Create special udev test rules on every node
- if [ -f $LUSTRE/lustre/conf/99-lustre.rules ]; then {
- sed -e 's|/usr/sbin/lctl|$LCTL|g' $LUSTRE/lustre/conf/99-lustre.rules > /etc/udev/rules.d/99-lustre-test.rules
- } else {
- echo "SUBSYSTEM==\"lustre\", ACTION==\"change\", ENV{PARAM}==\"?*\", RUN+=\"$LCTL set_param '\$env{PARAM}=\$env{SETTING}'\"" > /etc/udev/rules.d/99-lustre-test.rules
- } fi
- udevadm control --reload-rules
- udevadm trigger
+do_lnetctl() {
+ $LCTL mark "$LNETCTL $*"
+ echo "$LNETCTL $*"
+ $LNETCTL "$@"
+}
+load_lnet() {
# For kmemleak-enabled kernels we need clear all past state
# that obviously has nothing to do with this Lustre run
# Disable automatic memory scanning to avoid perf hit.
load_module ../libcfs/libcfs/libcfs
# Prevent local MODOPTS_LIBCFS being passed as part of environment
# variable to remote nodes
- MODOPTS_LIBCFS=$saved_opts
+ unset MODOPTS_LIBCFS
- set_default_debug
- load_module ../lnet/lnet/lnet
+ set_default_debug "neterror net nettrace malloc"
+ if [ "$1" = "config_on_load=1" ]; then
+ load_module ../lnet/lnet/lnet
+ else
+ load_module ../lnet/lnet/lnet "$@"
+ fi
LNDPATH=${LNDPATH:-"../lnet/klnds"}
if [ -z "$LNETLND" ]; then
case $NETTYPE in
- o2ib*) LNETLND="o2iblnd/ko2iblnd" ;;
- tcp*) LNETLND="socklnd/ksocklnd" ;;
- *) local lnd="${NETTYPE%%[0-9]}lnd"
+ o2ib*) LNETLND="o2iblnd/ko2iblnd" ;;
+ tcp*) LNETLND="socklnd/ksocklnd" ;;
+ *) local lnd="${NETTYPE%%[0-9]}lnd"
[ -f "$LNDPATH/$lnd/k$lnd.ko" ] &&
LNETLND="$lnd/k$lnd" ||
LNETLND="socklnd/ksocklnd"
esac
fi
load_module ../lnet/klnds/$LNETLND
+
+ if [ "$1" = "config_on_load=1" ]; then
+ do_lnetctl lnet configure --all ||
+ return $?
+ fi
+}
+
+load_modules_local() {
+ if [ -n "$MODPROBE" ]; then
+ # use modprobe
+ echo "Using modprobe to load modules"
+ return 0
+ fi
+
+ # Create special udev test rules on every node
+ if [ -f $LUSTRE/lustre/conf/99-lustre.rules ]; then {
+ sed -e 's|/usr/sbin/lctl|$LCTL|g' $LUSTRE/lustre/conf/99-lustre.rules > /etc/udev/rules.d/99-lustre-test.rules
+ } else {
+ echo "SUBSYSTEM==\"lustre\", ACTION==\"change\", ENV{PARAM}==\"?*\", RUN+=\"$LCTL set_param '\$env{PARAM}=\$env{SETTING}'\"" > /etc/udev/rules.d/99-lustre-test.rules
+ } fi
+ udevadm control --reload-rules
+ udevadm trigger
+
+ load_lnet
+
load_module obdclass/obdclass
if ! client_only; then
MODOPTS_PTLRPC=${MODOPTS_PTLRPC:-"lbug_on_grant_miscount=1"}