. $LUSTRE/tests/test-framework.sh
init_test_env $@
-init_logging
-# STORED_MDSSIZE is used in test_18
-if [ -n "$MDSSIZE" ]; then
- STORED_MDSSIZE=$MDSSIZE
-fi
+
# use small MDS + OST size to speed formatting time
# do not use too small MDSSIZE/OSTSIZE, which affect the default jouranl size
MDSSIZE=200000
OSTSIZE=200000
. ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
+# STORED_MDSSIZE is used in test_18
+if [ -n "$MDSSIZE" ]; then
+ STORED_MDSSIZE=$MDSSIZE
+fi
+
+init_logging
+
require_dsh_mds || exit 0
require_dsh_ost || exit 0
}
setup() {
- start_ost
- start_mds
- mount_client $MOUNT
+ start_ost || error "OST start failed"
+ start_mds || error "MDT start failed"
+ mount_client $MOUNT || error "client start failed"
}
setup_noconfig() {
test_1() {
start_ost
echo "start ost second time..."
- setup
+ start_ost && error "2nd OST start should fail"
+ start_mds || error "MDT start failed"
+ mount_client $MOUNT || error "client start failed"
check_mount || return 42
cleanup || return $?
}
start_ost
start_mds
echo "start mds second time.."
- start_mds
+ start_mds && error "2nd MDT start should fail"
mount_client $MOUNT
check_mount || return 43
cleanup || return $?
test_3() {
setup
#mount.lustre returns an error if already in mtab
- mount_client $MOUNT && return $?
+ mount_client $MOUNT && error "2nd client mount should fail"
check_mount || return 44
cleanup || return $?
}
# Workaround a YALA bug where YALA expects that modules will remain
# loaded on the servers
LOAD_MODULES_REMOTE=false
+ load_modules
setup
cleanup
}
shift
BASE=`basename $module $EXT`
+ module_loaded ${BASE} && return
+
# If no module arguments were passed, get them from $MODOPTS_<MODULE>, else from
# modprobe.conf
if [ $# -eq 0 ]; then
[ $# -gt 0 ] && echo "${module} options: '$*'"
- module_loaded ${BASE} && return
-
# Note that insmod will ignore anything in modprobe.conf, which is why we're
# passing options on the command-line.
if [ "$BASE" == "lnet_selftest" ] && \
echo "Using modprobe to load modules"
return 0
fi
- if [ "$HAVE_MODULES" = true ]; then
- # we already loaded
- echo "Modules already loaded"
- return 0
- fi
- HAVE_MODULES=true
echo Loading modules from $LUSTRE
load_module ../libcfs/libcfs/libcfs
fi
fi
- HAVE_MODULES=false
-
check_mem_leak || return 254
echo "modules unloaded."
local dev=$1
local devname=$(basename $1)
local size=$(grep "$devname"$ /proc/partitions | awk '{print $3}')
+ # loop devices aren't in /proc/partitions
+ [ "x$size" == "x" ] && local size=$(ls -l $dev | awk '{print $5}')
+
size=$(($size / 1024 / 1024)) # Gb
local partial_arg=""