Whamcloud - gitweb
b=13283
authorgrev <grev>
Wed, 12 Mar 2008 18:01:23 +0000 (18:01 +0000)
committergrev <grev>
Wed, 12 Mar 2008 18:01:23 +0000 (18:01 +0000)
i=Adilger

rsh do_node fix

lustre/tests/test-framework.sh

index 66ef7a8..91856a4 100644 (file)
@@ -811,6 +811,17 @@ do_node() {
         echo "CMD: $HOST $@" >&2
         $myPDSH $HOST $LCTL mark "$@" > /dev/null 2>&1 || :
     fi
+
+    if [ "$myPDSH" = "rsh" ]; then
+# we need this because rsh does not return exit code of an executed command
+       local command_status="$TMP/cs"
+       rsh $HOST ":> $command_status"
+       rsh $HOST "(PATH=\$PATH:$RLUSTRE/utils:$RLUSTRE/tests:/sbin:/usr/sbin;
+                   cd $RPWD; sh -c \"$@\") || 
+                   echo command failed >$command_status"
+       [ -n "$($myPDSH $HOST cat $command_status)" ] && return 1 || true
+        return 0
+    fi
     $myPDSH $HOST "(PATH=\$PATH:$RLUSTRE/utils:$RLUSTRE/tests:/sbin:/usr/sbin; cd $RPWD; sh -c \"$@\")" | sed "s/^${HOST}: //"
     return ${PIPESTATUS[0]}
 }