Whamcloud - gitweb
b=21881 Fix trap in rpc.sh.
[fs/lustre-release.git] / lustre / tests / rpc.sh
index 11c5181..098df10 100755 (executable)
@@ -3,12 +3,18 @@ export PATH=`dirname $0`/../utils:$PATH
 NAME=${NAME:-local}
 
 LUSTRE=${LUSTRE:-$(cd $(dirname $0)/..; echo $PWD)}
+
+if [ ! -f $LUSTRE/tests/rpc.sh ]; then
+    LUSTRE=$(cd $(dirname $(which $0))/..; echo $PWD)
+fi
+
 . $LUSTRE/tests/test-framework.sh
-init_test_env $@
+init_test_env
 . ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
 
-cmd=$1
-shift
-$cmd $@
+# Reset the trap on ERR set by the framework.  Noticing this failure is the
+# framework's job.
+trap - ERR
 
-exit $?
+# Execute the command
+"$@"