X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Ftests%2Ffunctions.sh;h=1807bb8d1771340156db269a6b41dd5ff7022f58;hp=b016732e55d3b440db87302324c753ef26ecb838;hb=56f69854dae234fa974ab4f1dff909aea601a592;hpb=103be254e14d740ad2483169bde7376736dc85a0 diff --git a/lustre/tests/functions.sh b/lustre/tests/functions.sh index b016732..1807bb8 100644 --- a/lustre/tests/functions.sh +++ b/lustre/tests/functions.sh @@ -169,26 +169,26 @@ signaled() { } mpi_run () { - local mpirun="$MPIRUN $MPIRUN_OPTIONS" - local command="$mpirun $@" - local mpilog=$TMP/mpi.log - local rc - - if [ -n "$MPI_USER" -a "$MPI_USER" != root -a -n "$mpirun" ]; then - echo "+ chmod 0777 $MOUNT" - chmod 0777 $MOUNT - command="su $MPI_USER sh -c \"$command \"" - fi + local mpirun="$MPIRUN $MPIRUN_OPTIONS" + local command="$mpirun $@" + local mpilog=$TMP/mpi.log + local rc + + if [ -n "$MPI_USER" -a "$MPI_USER" != root -a -n "$mpirun" ]; then + echo "+ chmod 0777 $MOUNT" + chmod 0777 $MOUNT + command="su $MPI_USER bash -c \"$command \"" + fi - ls -ald $MOUNT - echo "+ $command" - eval $command 2>&1 | tee $mpilog || true + ls -ald $MOUNT + echo "+ $command" + eval $command 2>&1 | tee $mpilog || true - rc=${PIPESTATUS[0]} - if [ $rc -eq 0 ] && grep -q "p4_error:" $mpilog ; then - rc=1 - fi - return $rc + rc=${PIPESTATUS[0]} + if [ $rc -eq 0 ] && grep -q "p4_error:" $mpilog ; then + rc=1 + fi + return $rc } nids_list () {