Whamcloud - gitweb
LU-121 Fixup yaml.sh and test-framework.sh so that it only ever uses the first
[fs/lustre-release.git] / lustre / tests / functions.sh
index 4d9ea51..19b3cc6 100644 (file)
@@ -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)
+}
+