FORCE=${FORCE:-" --force"}
+if [ "$VERBOSE" == "true" ]; then
+ CMDVERBOSE=""
+else
+ CMDVERBOSE=" > /dev/null"
+fi
+
gen_config() {
rm -f $XMLCONFIG
start_mds() {
echo "start mds service on `facet_active_host mds`"
- start mds --reformat $MDSLCONFARGS > /dev/null || return 94
+ start mds --reformat $MDSLCONFARGS $CMDVERBOSE || return 94
}
stop_mds() {
echo "stop mds service on `facet_active_host mds`"
- stop mds $@ > /dev/null || return 97
+ stop mds $@ $CMDVERBOSE || return 97
}
start_ost() {
echo "start ost service on `facet_active_host ost`"
- start ost --reformat $OSTLCONFARGS > /dev/null || return 95
+ start ost --reformat $OSTLCONFARGS $CMDVERBOSE || return 95
}
stop_ost() {
echo "stop ost service on `facet_active_host ost`"
- stop ost $@ > /dev/null || return 98
+ stop ost $@ $CMDVERBOSE || return 98
}
mount_client() {
local MOUNTPATH=$1
echo "mount lustre on ${MOUNTPATH}....."
- zconf_mount $MOUNTPATH > /dev/null || return 96
+ zconf_mount $MOUNTPATH $CMDVERBOSE || return 96
}
umount_client() {
local MOUNTPATH=$1
echo "umount lustre on ${MOUNTPATH}....."
- zconf_umount $MOUNTPATH > /dev/null || return 97
+ zconf_umount $MOUNTPATH $CMDVERBOSE || return 97
}
manual_umount_client(){
}
cleanup() {
- umount_client $MOUNT || return -200
- stop_mds || return -201
- stop_ost || return -202
+ umount_client $MOUNT || return 200
+ stop_mds || return 201
+ stop_ost || return 202
+ # catch case where these return just fine, but modules are still not unloaded
+ /sbin/lsmod | grep -q portals
+ if [ 1 -ne $? ]; then
+ echo "modules still loaded..."
+ return 203
+ fi
}
check_mount() {
start_mds
mount_client $MOUNT
check_mount || return 41
- cleanup
+ cleanup || return $?
}
run_test 0 "single mount setup"
test_1() {
start_ost
echo "start ost second time..."
- start ost --reformat $OSTLCONFARGS > /dev/null
+ start ost --reformat $OSTLCONFARGS $CMDVERBOSE
start_mds
mount_client $MOUNT
check_mount || return 42
- cleanup
+ cleanup || return $?
}
run_test 1 "start up ost twice"
start_ost
start_mds
echo "start mds second time.."
- start mds --reformat $MDSLCONFARGS > /dev/null
+ start mds --reformat $MDSLCONFARGS $CMDVERBOSE
mount_client $MOUNT
check_mount || return 43
- cleanup
+ cleanup || return $?
}
run_test 2 "start up mds twice"
check_mount || return 44
umount_client $MOUNT
- cleanup
+ cleanup || return $?
}
run_test 3 "mount client twice"
setup
touch $DIR/$tfile || return 85
stop_ost ${FORCE}
-
- # cleanup may return an error from the failed
- # disconnects; for now I'll consider this successful
- # if all the modules have unloaded.
- if ! cleanup ; then
- lsmod | grep -q portals && return 1
- fi
+ cleanup
+ eno=$?
+ # ok for ost to fail shutdown
+ if [ 202 -ne $eno ]; then
+ return $eno;
+ fi
return 0
}
run_test 4 "force cleanup ost, then cleanup"
setup
touch $DIR/$tfile || return 86
stop_mds ${FORCE} || return 98
-
- # cleanup may return an error from the failed
- # disconnects; for now I'll consider this successful
- # if all the modules have unloaded.
- if ! cleanup ; then
- lsmod | grep -q portals && return 1
- fi
+ cleanup
+ eno=$?
+ # ok for mds to fail shutdown
+ if [ 201 -ne $eno ]; then
+ return $eno;
+ fi
return 0
}
run_test 5 "force cleanup mds, then cleanup"
manual_umount_client
mount_client ${MOUNT} || return 87
touch $DIR/a || return 86
- cleanup
+ cleanup || return $?
}
run_test 6 "manual umount, then mount again"
test_7() {
setup
manual_umount_client
- cleanup
+ cleanup || return $?
}
run_test 7 "manual umount, then cleanup"
return 1
fi
check_mount || return 41
- cleanup
+ cleanup || return $?
# the new PTLDEBUG/SUBSYSTEM used for lconf --ptldebug/subsystem
PTLDEBUG="inode+trace"
fi
mount_client $MOUNT
check_mount || return 41
- cleanup
+ cleanup || return $?
# resume the old configuration
PTLDEBUG=$OLDPTLDEBUG