X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Ftests%2Ffunctions.sh;h=19b3cc6730a1b1f6b02edb6073f6a90dd64b708a;hb=c2751b31e55518d1791cd5b87adc842f4fbbee83;hp=4d9ea51eb4d8244c8a897714342fe59687806b26;hpb=8d239ab2b8059460a1925351011afbbe712ae989;p=fs%2Flustre-release.git diff --git a/lustre/tests/functions.sh b/lustre/tests/functions.sh index 4d9ea51..19b3cc6 100644 --- a/lustre/tests/functions.sh +++ b/lustre/tests/functions.sh @@ -174,7 +174,7 @@ mpi_run () { local mpilog=$TMP/mpi.log local rc - if [ "$MPI_USER" != root -a $mpirun ]; then + 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 \"" @@ -241,3 +241,12 @@ lst_setup_all () { do_rpc_nodes $list lst_setup } +### +# short_hostname +# +# Passed a single argument, strips everything off following and includes the first period. +# client-20.lab.whamcloud.com becomes client-20 +short_hostname() { + echo $(sed 's/\..*//' <<< $1) +} +