Pārlūkot izejas kodu

HDFS-549. Add a new target, run-with-fault-inject-testcaseonly, which allows an execution of non-FI tests in FI-enable environment. Contributed by Konstantin Boudnik

git-svn-id: https://svn.apache.org/repos/asf/hadoop/hdfs/trunk@810631 13f79535-47bb-0310-9956-ffa450edef68
Tsz-wo Sze 16 gadi atpakaļ
vecāks
revīzija
7776cc63b5
2 mainītis faili ar 21 papildinājumiem un 0 dzēšanām
  1. 4 0
      CHANGES.txt
  2. 17 0
      build.xml

+ 4 - 0
CHANGES.txt

@@ -118,6 +118,10 @@ Trunk (unreleased changes)
 
 
     HDFS-581. Introduce an iterator over blocks in the block report array. (shv)
     HDFS-581. Introduce an iterator over blocks in the block report array. (shv)
 
 
+    HDFS-549. Add a new target, run-with-fault-inject-testcaseonly, which
+    allows an execution of non-FI tests in FI-enable environment.  (Konstantin
+    Boudnik via szetszwo)
+
   BUG FIXES
   BUG FIXES
 
 
     HDFS-76. Better error message to users when commands fail because of 
     HDFS-76. Better error message to users when commands fail because of 

+ 17 - 0
build.xml

@@ -358,6 +358,17 @@
   <!--At this moment there's no special FI test suite thus the normal tests are -->
   <!--At this moment there's no special FI test suite thus the normal tests are -->
   <!--being executed with faults injected in place-->
   <!--being executed with faults injected in place-->
 
 
+  <!--This target is not included into the the top level list of target
+  for it serves a special "regression" testing purpose of non-FI tests in
+  FI environment -->
+  <target name="run-with-fault-inject-testcaseonly">
+    <fail unless="testcase">Can't run this target without -Dtestcase setting!
+    </fail>
+    <subant buildpath="build.xml" target="run-test-hdfs-fault-inject">
+    	<property name="special.fi.testcasesonly" value="yes"/>
+    </subant>
+  </target>
+
   <target name="run-test-hdfs-fault-inject" depends="injectfaults"
   <target name="run-test-hdfs-fault-inject" depends="injectfaults"
           description="Run Fault Injection related hdfs tests">
           description="Run Fault Injection related hdfs tests">
     <subant buildpath="build.xml" target="run-test-hdfs">
     <subant buildpath="build.xml" target="run-test-hdfs">
@@ -637,6 +648,12 @@
         <batchtest todir="${test.build.dir}" if="tests.testcase.fi">
         <batchtest todir="${test.build.dir}" if="tests.testcase.fi">
           <fileset dir="${test.src.dir}/aop" includes="**/${testcase}.java"/>
           <fileset dir="${test.src.dir}/aop" includes="**/${testcase}.java"/>
         </batchtest>
         </batchtest>
+        <!--The following batch is for very special occasions only when
+        a non-FI tests are needed to be executed against FI-environment -->
+        <batchtest todir="${test.build.dir}" if="special.fi.testcasesonly">
+          <fileset dir="${test.src.dir}/aop" includes="**/${testcase}.java"/>
+          <fileset dir="${test.src.dir}/hdfs" includes="**/${testcase}.java"/>
+        </batchtest>
       </junit>
       </junit>
       <antcall target="checkfailure"/>
       <antcall target="checkfailure"/>
     </sequential>
     </sequential>