workdir=`pwd`
+cleanup()
+{
+ curdir=`pwd`
+ cd $LTREE_KERNEL/tests
+ $LCONF --node localhost --cleanup --force $LTREE_USER/tests/$configfile 2>&1 > /dev/null
+ cd $curdir
+}
+
configfile=liblustre_sanity_uml.xml
# generate config file
rm -f $configfile
MDSNODE=localhost OSTNODES=localhost CLIENTS=$LLIP sh uml.sh $configfile
+if [ ! -e $configfile ]; then
+ echo "fail to generate config file $configfile"
+ exit 1
+fi
# generate dump file
rm -f /tmp/DUMP_FILE
$LCONF --lctl_dump /tmp/DUMP_FILE --node $LLIP $configfile
-
if [ ! -e /tmp/DUMP_FILE ]; then
- echo "error create dumpfile"
+ echo "error creating dumpfile"
exit 1
fi
#setup lustre server
cd $LTREE_KERNEL/tests
-$LCONF --node localhost $LTREE_USER/tests/$configfile
+$LCONF --node localhost --reformat $LTREE_USER/tests/$configfile
rc=$?
if [ $rc -ne 0 ]; then
echo "setup lustre server: error $rc"
+ cleanup
exit 1
fi
cd $workdir
#do liblustre testing
-$LTREE_USER/liblustre/lltest $LLIP
+$LTREE_USER/liblustre/lltest
rc=$?
if [ $rc -ne 0 ]; then
echo "liblustre test error $rc"
+ cleanup
exit 1
fi
-echo "========== liblustre sanity test complete sucessfully =========="
+echo "===== liblustre sanity test complete sucessfully ====="
-echo -n "======= cleanup... "
-cd $LTREE_KERNEL/tests
-$LCONF --node localhost --cleanup --force $LTREE_USER/tests/$configfile 2>&1 > /dev/null
-echo "done ======="
+echo -n "===== cleanup... "; cleanup; echo "done ====="
cd $workdir
+
+exit 0