[ "$DEBUG" ] && debug_opt="--ptldebug=$DEBUG"
[ "$PTLDEBUG" ] && debug_opt="--ptldebug=$PTLDEBUG"
-echo llmount: FIXME use the utils/cluster_scripts/cluster_config.sh to parse config csv files.
+echo llmount: FIXME replace llmount.sh with ". mountconf.sh" and "$SETUP"
exit 1
#${LCONF} $NOMOD $portals_opt $lustre_opt $node_opt --cleanup $@ \
--dump $TMP/debug $conf_opt
-echo FIXME this must be umount of some sort
+echo FIXME llmountcleanup should be replaced with $CLEANUP
exit 1
rc=$?
--- /dev/null
+#!/bin/sh
+
+#set -vx
+
+# mountconf setup of MDS and two OSTs
+
+export PATH=`dirname $0`/../utils:$PATH
+
+LUSTRE=${LUSTRE:-`dirname $0`/..}
+. $LUSTRE/tests/test-framework.sh
+
+init_test_env $@
+
+. ${CONFIG:=$LUSTRE/tests/cfg/local.sh}
+
+
+unload_modules() {
+ $LCTL dk $TMP/debug
+ $LCTL modules | awk '{ print $2 }' | xargs rmmod >/dev/null 2>&1
+ # do it again, in case we tried to unload ksocklnd too early
+ LNET=$(lsmod | grep -c lnet)
+ if [ $LNET -ne 0 ]; then
+ $LCTL modules | awk '{ print $2 }' | xargs rmmod
+ fi
+ lsmod | grep lnet && echo "modules still loaded" && exit 1
+
+ LEAK_LUSTRE=`dmesg | tail -n 30 | grep "obd mem.*leaked"`
+ LEAK_PORTALS=`dmesg | tail -n 20 | grep "Portals memory leaked"`
+ if [ "$LEAK_LUSTRE" -o "$LEAK_PORTALS" ]; then
+ echo "$LEAK_LUSTRE" 1>&2
+ echo "$LEAK_PORTALS" 1>&2
+ mv $TMP/debug $TMP/debug-leak.`date +%s`
+ echo "Memory leaks detected"
+ exit 254
+ fi
+}
+
+stop_all() {
+ grep " $MOUNT " /proc/mounts && zconf_umount `hostname` $MOUNT
+ stop ost -f
+ stop ost2 -f
+ stop mds -f
+}
+
+mccleanup() {
+ echo "mountconf cleanup $*"
+ stop_all
+ unload_modules
+}
+
+REFORMAT=${REFORMAT:---reformat}
+
+format() {
+ stop_all
+ echo Formatting mds, ost, ost2
+ add mds $MDS_MKFS_OPTS $REFORMAT $MDSDEV > /dev/null || exit 10
+ add ost $OST_MKFS_OPTS $REFORMAT $OSTDEV > /dev/null || exit 10
+ add ost2 $OST2_MKFS_OPTS $REFORMAT $OSTDEV2 > /dev/null || exit 10
+}
+format
+
+mcsetup() {
+ echo Setup mds, ost, ost2
+ start mds $MDSDEV $MDS_MOUNT_OPTS
+ start ost $OSTDEV $OST_MOUNT_OPTS
+ start ost2 $OSTDEV2 $OST2_MOUNT_OPTS
+ [ "$DAEMONFILE" ] && $LCTL debug_daemon start $DAEMONFILE $DAEMONSIZE
+
+ grep " $MOUNT " /proc/mounts || zconf_mount `hostname` $MOUNT
+ sleep 5
+}
+
+export MCSETUP=${MCSETUP:-"mcsetup"}
+export MCCLEANUP=${MCCLEANUP:-"mccleanup"}
+
+
+#${LCONF} $NOMOD $portals_opt $lustre_opt $debug_opt $node_opt ${REFORMAT:---reformat} $@ $conf_opt || {
+ # maybe acceptor error, dump tcp port usage
+# netstat -tpn
+# exit 2
+#}
+
+#if [ "$MOUNT2" ]; then
+# $LLMOUNT -v -o user_xattr,acl `hostname`:/mds1/client $MOUNT2 || exit 3
+#fi
if [ "$ONLY" == "cleanup" ]; then
sysctl -w lnet.debug=0 || true
$CLEANUP
- exit
+ exit 0
fi
setup() {
#add_lov lov1 mds --stripe_sz $STRIPE_BYTES --stripe_cnt $STRIPES_PER_OBJ --stripe_pattern 0
grep " $MOUNT " /proc/mounts || zconf_mount `hostname` $MOUNT
- sleep 10
}
$SETUP
run_test 58 "test recovery from llog for setattr op (test llog_gen_rec)"
equals_msg test complete, cleaning up
-FORCE=$CLEANUP
+$CLEANUP
SAVE_PWD=$PWD
-clean() {
+# for MCSETUP and MCCLEANUP
+. mountconf.sh
+
+cleanup() {
echo -n "cln.."
- sh llmountcleanup.sh ${FORCE} > /dev/null || { echo "FAILed to clean up"; exit 20; }
+ $MCCLEANUP ${FORCE} > /dev/null || { echo "FAILed to clean up"; exit 20; }
}
-CLEAN=${CLEAN:-:}
+CLEANUP=${CLEANUP:-:}
-start() {
+setup() {
echo -n "mnt.."
- sh llmount.sh > /dev/null || exit 10
+ $MCSETUP
+#$MCSETUP > /dev/null || exit 10
echo "done"
}
-START=${START:-:}
+SETUP=${SETUP:-:}
log() {
echo "$*"
}
run_one() {
- if ! mount | grep -q $DIR; then
- $START
+ if ! grep -q $DIR /proc/mounts; then
+ $SETUP
fi
testnum=$1
message=$2
unset TESTNAME
pass "($((`date +%s` - $BEFORE))s)"
cd $SAVE_PWD
- $CLEAN
+ $CLEANUP
}
build_test_filter() {
mounted_lustre_filesystems() {
awk '($3 ~ "lustre" && $1 ~ ":") { print $2 }' /proc/mounts
}
-MOUNT="`mounted_lustre_filesystems`"
-if [ -z "$MOUNT" ]; then
- sh llmount.sh
- MOUNT="`mounted_lustre_filesystems`"
- [ -z "$MOUNT" ] && error "NAME=$NAME not mounted"
+MOUNTED="`mounted_lustre_filesystems`"
+if [ -z "$MOUNTED" ]; then
+ $MCSETUP
+ MOUNTED="`mounted_lustre_filesystems`"
+ [ -z "$MOUNTED" ] && error "NAME=$NAME not mounted"
I_MOUNTED=yes
fi
$CHECKSTAT ${f}.rename
$CHECKSTAT -a ${f}
}
-run_test 24n "Statting the old file after renameing (Posix rename 2)"
+run_test 24n "Statting the old file after renaming (Posix rename 2)"
test_24o() {
check_kernel_version 37 || return 0
exhaust_precreations() {
OSTIDX=$1
- OST=grep ${OSTIDX}": " $LPROC/lov/${LOVNAME}/target_obd | \
- awk '{print $2}' | sed -e 's/_UUID$//'
-
+ OST=$(grep ${OSTIDX}": " $LPROC/lov/${LOVNAME}/target_obd | \
+ awk '{print $2}' | sed -e 's/_UUID$//')
+ # on the mdt's osc
last_id=$(cat $LPROC/osc/${OST}-osc/prealloc_last_id)
next_id=$(cat $LPROC/osc/${OST}-osc/prealloc_next_id)
run_test 28 "create/mknod/mkdir with bad file types ============"
cancel_lru_locks() {
- for d in $LPROC/ldlm/namespaces/*-$1*; do
+ for d in $LPROC/ldlm/namespaces/*-$1-*; do
echo clear > $d/lru_size
done
- grep "[0-9]" $LPROC/ldlm/namespaces/$1*/lock_unused_count /dev/null
+ grep "[0-9]" $LPROC/ldlm/namespaces/*-$1-*/lock_unused_count /dev/null
}
test_29() {
touch $DIR/d29/foo
log 'first d29'
ls -l $DIR/d29
- MDCDIR=${MDCDIR:-$LPROC/ldlm/namespaces/*-mdc*}
+ MDCDIR=${MDCDIR:-$LPROC/ldlm/namespaces/*-mdc-*}
LOCKCOUNTORIG=`cat $MDCDIR/lock_count`
LOCKUNUSEDCOUNTORIG=`cat $MDCDIR/lock_unused_count`
log 'second d29'
test_65j() { # bug6367
# if we aren't already remounting for each test, do so for this test
- if [ "$CLEAN" = ":" ]; then
- clean || error "failed to unmount"
- start || error "failed to remount"
+ if [ "$CLEANUP" = ":" ]; then
+ cleanup || error "failed to unmount"
+ setup || error "failed to remount"
fi
$LSTRIPE -d $MOUNT || true
}
if [ "`mount | grep ^$NAME`" ]; then
rm -rf $DIR/[Rdfs][1-9]*
if [ "$I_MOUNTED" = "yes" ]; then
- sh llmountcleanup.sh || error "llmountcleanup failed"
+ $MCCLEANUP || error "cleanup failed"
fi
fi
stop() {
facet=$1
shift
- local running=`do_facet ${facet} mount | grep -c /mnt/${facet}" "`
+ local running=`do_facet ${facet} grep -c /mnt/${facet}" " /proc/mounts`
if [ $running -ne 0 ]; then
echo "Stopping /mnt/${facet} (opts:$@)"
do_facet ${facet} umount -d $@ /mnt/${facet}
zconf_mount() {
local OPTIONS
- client=$1
- mnt=$2
+ local client=$1
+ local mnt=$2
+ if [ -z "$mnt" ]; then
+ echo No mount point given: zconf_mount $*
+ exit 1
+ fi
do_node $client mkdir $mnt 2> /dev/null || :