From 109c101f653e5fb1fd3620a985c491c4e96785f5 Mon Sep 17 00:00:00 2001 From: gord-fig Date: Tue, 17 Sep 2002 21:11:18 +0000 Subject: [PATCH] Clean up runtests for inclusion in ltest. --- lustre/tests/runtests | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lustre/tests/runtests b/lustre/tests/runtests index 820a70b..c53596e 100755 --- a/lustre/tests/runtests +++ b/lustre/tests/runtests @@ -5,6 +5,11 @@ # In the future this can become more fancy, but it's OK for now. SRCDIR="`dirname $0`" +fail() { + echo "ERROR: $1" 1>&2 + [ $2 ] && RC=$2 || RC=1 + exit $RC +} export PATH=/sbin:/usr/sbin:$SRCDIR:$PATH @@ -18,8 +23,10 @@ SRC=/etc OSCMT="`mount | awk '/ lustre_lite / { print $3 }'`" if [ -z "$OSCMT" ]; then $LCONF $REFORMAT $@ || exit 1 - MTPT="`mount | awk '/ lustre_lite / { print $3 }'`" + trap "$LCONF --cleanup $@" 0 + OSCMT="`mount | awk '/ lustre_lite / { print $3 }'`" [ -z "$OSCMT" ] && echo "no lustre filesystem mounted" 2>&1 && exit 1 + exit $RC fi # let's start slowly here... -- 1.8.3.1