[llvm-commits] [test-suite] r55980 - in /test-suite/trunk: Makefile.programs RunSafely.sh

Evan Cheng evan.cheng at apple.com
Mon Sep 8 23:12:33 PDT 2008


Author: evancheng
Date: Tue Sep  9 01:12:33 2008
New Revision: 55980

URL: http://llvm.org/viewvc/llvm-project?rev=55980&view=rev
Log:
Allow use of ssh to perform remote execution.

Modified:
    test-suite/trunk/Makefile.programs
    test-suite/trunk/RunSafely.sh

Modified: test-suite/trunk/Makefile.programs
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/Makefile.programs?rev=55980&r1=55979&r2=55980&view=diff

==============================================================================
--- test-suite/trunk/Makefile.programs (original)
+++ test-suite/trunk/Makefile.programs Tue Sep  9 01:12:33 2008
@@ -86,10 +86,21 @@
 RUNSAFELY := $(PROGDIR)/RunSafelyAndStable.sh $(RUNTIMELIMIT) $(EXIT_OK)
 else
 ifdef REMOTE_HOST
+ifndef REMOTE_CLIENT
+REMOTE_CLIENT := rsh
+endif
 ifdef REMOTE_USER
-RUNSAFELY := $(PROGDIR)/RunSafely.sh -r $(REMOTE_HOST) -l $(REMOTE_USER) $(RUNTIMELIMIT) $(EXIT_OK)
+ifdef REMOTE_OPTIONS
+RUNSAFELY := $(PROGDIR)/RunSafely.sh -r $(REMOTE_HOST) -l $(REMOTE_USER) -rc $(REMOTE_CLIENT) -ro "$(REMOTE_OPTIONS)" $(RUNTIMELIMIT) $(EXIT_OK)
+else
+RUNSAFELY := $(PROGDIR)/RunSafely.sh -r $(REMOTE_HOST) -l $(REMOTE_USER) -rc $(REMOTE_CLIENT) $(RUNTIMELIMIT) $(EXIT_OK)
+endif
 else
-RUNSAFELY := $(PROGDIR)/RunSafely.sh -r $(REMOTE_HOST) $(RUNTIMELIMIT) $(EXIT_OK)
+ifdef REMOTE_OPTIONS
+RUNSAFELY := $(PROGDIR)/RunSafely.sh -r $(REMOTE_HOST) -rc $(REMOTE_CLIENT) -ro "$(REMOTE_OPTIONS)" $(RUNTIMELIMIT) $(EXIT_OK)
+else
+RUNSAFELY := $(PROGDIR)/RunSafely.sh -r $(REMOTE_HOST) -rc $(REMOTE_CLIENT) $(RUNTIMELIMIT) $(EXIT_OK)
+endif
 endif
 else
 RUNSAFELY := $(PROGDIR)/RunSafely.sh $(RUNTIMELIMIT) $(EXIT_OK)

Modified: test-suite/trunk/RunSafely.sh
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/RunSafely.sh?rev=55980&r1=55979&r2=55980&view=diff

==============================================================================
--- test-suite/trunk/RunSafely.sh (original)
+++ test-suite/trunk/RunSafely.sh Tue Sep  9 01:12:33 2008
@@ -22,12 +22,14 @@
 #
 # Syntax: 
 #
-#   RunSafely.sh [-r <rhost>] [-l <ruser>]
+#   RunSafely.sh [-r <rhost>] [-l <ruser>] [-rc <client>] [-ro <roptions>]
 #                <timeout> <exitok> <infile> <outfile> <program> <args...>
 #
 #   where:
 #     <rhost>   is the remote host to execute the program
 #     <ruser>   is the username on the remote host
+#     <client>  is the remote client used to execute the program
+#     <roptions>is the extra options passed to the remote client
 #     <timeout> is the maximum number of seconds to let the <program> run
 #     <exitok>  is 1 if the program must exit with 0 return code
 #     <infile>  is a file from which standard input is directed
@@ -44,7 +46,8 @@
 
 RHOST=
 RUSER=`id -un`
-FLAG=$1
+RCLIENT=rsh
+ROPTIONS=""
 if [ $1 = "-r" ]; then
   RHOST=$2
   shift 2
@@ -53,6 +56,14 @@
   RUSER=$2
   shift 2
 fi
+if [ $1 = "-rc" ]; then
+  RCLIENT=$2
+  shift 2
+fi
+if [ $1 = "-ro" ]; then
+  ROPTIONS=$2
+  shift 2
+fi
 
 ULIMIT=$1
 EXITOK=$2
@@ -119,8 +130,8 @@
   echo "$ULIMITCMD cd $PWD; (time -p ($COMMAND > $OUTFILE.remote 2>&1 < $INFILE;); echo exit $?) > $OUTFILE.remote.time 2>&1" > "$PWD/${PROGRAM}.command"
   chmod +x "$PWD/${PROGRAM}.command"
 
-  ( rsh -l $RUSER $RHOST "ls $PWD/${PROGRAM}.command" ) > /dev/null 2>&1
-  ( rsh -l $RUSER $RHOST "$PWD/${PROGRAM}.command" )
+  ( $RCLIENT -l $RUSER $RHOST $ROPTIONS "ls $PWD/${PROGRAM}.command" ) > /dev/null 2>&1
+  ( $RCLIENT -l $RUSER $RHOST $ROPTIONS "$PWD/${PROGRAM}.command" )
   cat $OUTFILE.remote.time | awk -- '\
 BEGIN     { cpu = 0.0; }
 /^user/   { cpu += $2; print; }





More information about the llvm-commits mailing list