Pārlūkot izejas kodu

HADOOP-5232. Enable patch testing to occur on more than one host. Contributed by Giri Kesavan.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/trunk@748036 13f79535-47bb-0310-9956-ffa450edef68
Nigel Daley 16 gadi atpakaļ
vecāks
revīzija
305ebd04dd
3 mainītis faili ar 18 papildinājumiem un 8 dzēšanām
  1. 3 0
      CHANGES.txt
  2. 2 0
      build.xml
  3. 13 8
      src/test/bin/test-patch.sh

+ 3 - 0
CHANGES.txt

@@ -137,6 +137,9 @@ Trunk (unreleased changes)
     HADOOP-5264. Removes redundant configuration object from the TaskTracker.
     (Sharad Agarwal via ddas)
 
+    HADOOP-5232. Enable patch testing to occur on more than one host.
+    (Giri Kesavan via nigel)
+
   OPTIMIZATIONS
 
   BUG FIXES

+ 2 - 0
build.xml

@@ -1547,6 +1547,8 @@
     <arg value="${trigger.url}"/>
     <arg value="${jira.passwd}"/>
     <arg value="${java5.home}"/>
+    <arg value="${curl.cmd}"/>
+    <arg value="${defect}"/>
   </exec>
 </target>
 	

+ 13 - 8
src/test/bin/test-patch.sh

@@ -12,8 +12,8 @@ parseArgs() {
     HUDSON)
       ### Set HUDSON to true to indicate that this script is being run by Hudson
       HUDSON=true
-      if [[ $# != 17 ]] ; then
-        echo "ERROR: usage $0 HUDSON <PATCH_DIR> <SUPPORT_DIR> <PS_CMD> <WGET_CMD> <JIRACLI> <SVN_CMD> <GREP_CMD> <PATCH_CMD> <FINDBUGS_HOME> <FORREST_HOME> <ECLIPSE_HOME> <PYTHON_HOME> <WORKSPACE_BASEDIR> <TRIGGER_BUILD> <JIRA_PASSWD> <JAVA5_HOME> "
+      if [[ $# != 19 ]] ; then
+        echo "ERROR: usage $0 HUDSON <PATCH_DIR> <SUPPORT_DIR> <PS_CMD> <WGET_CMD> <JIRACLI> <SVN_CMD> <GREP_CMD> <PATCH_CMD> <FINDBUGS_HOME> <FORREST_HOME> <ECLIPSE_HOME> <PYTHON_HOME> <WORKSPACE_BASEDIR> <TRIGGER_BUILD> <JIRA_PASSWD> <JAVA5_HOME> <CURL_CMD> <DEFECT> "
         cleanupAndExit 0
       fi
       PATCH_DIR=$2
@@ -32,16 +32,19 @@ parseArgs() {
       TRIGGER_BUILD_URL=${15}
       JIRA_PASSWD=${16}
       JAVA5_HOME=${17}
+      CURL=${18}
+      defect=${19}
+		
       ### Retrieve the defect number
-      if [ ! -e $PATCH_DIR/defectNum ] ; then
-        echo "Could not determine the patch to test.  Exiting."
-        cleanupAndExit 0
-      fi
-      defect=`cat $PATCH_DIR/defectNum`
       if [ -z "$defect" ] ; then
         echo "Could not determine the patch to test.  Exiting."
         cleanupAndExit 0
       fi
+
+      if [ ! -e "$PATCH_DIR" ] ; then
+        mkdir -p $PATCH_DIR 
+      fi
+
       ECLIPSE_PROPERTY="-Declipse.home=$ECLIPSE_HOME"
       PYTHON_PROPERTY="-Dpython.home=$PYTHON_HOME"
       ;;
@@ -615,6 +618,8 @@ cleanupAndExit () {
     if [ -e "$PATCH_DIR" ] ; then
       mv $PATCH_DIR $BASEDIR
     fi
+  CALLER=`hostname`
+  $CURL $PATCH_ADMIN_URL'&CALLER='$CALLER
   fi
   echo ""
   echo ""
@@ -646,7 +651,7 @@ RESULT=$?
 if [[ $HUDSON == "true" ]] ; then
   if [[ $RESULT != 0 ]] ; then
     ### Resubmit build.
-    $WGET -q -O $PATCH_DIR/build $TRIGGER_BUILD_URL
+    $CURL $TRIGGER_BUILD_URL'&DEFECTNUM='$defect
     exit 100
   fi
 fi