|
@@ -29,6 +29,7 @@
|
|
<property name="name" value="hadoop"/>
|
|
<property name="name" value="hadoop"/>
|
|
<property name="version" value="0.20.100.0-dev"/>
|
|
<property name="version" value="0.20.100.0-dev"/>
|
|
<property name="final.name" value="${name}-${version}"/>
|
|
<property name="final.name" value="${name}-${version}"/>
|
|
|
|
+ <property name="test.final.name" value="${final.name}-test"/>
|
|
<property name="year" value="2009"/>
|
|
<property name="year" value="2009"/>
|
|
|
|
|
|
<property name="src.dir" value="${basedir}/src"/>
|
|
<property name="src.dir" value="${basedir}/src"/>
|
|
@@ -301,7 +302,7 @@
|
|
</copy>
|
|
</copy>
|
|
|
|
|
|
<exec executable="sh">
|
|
<exec executable="sh">
|
|
- <arg line="src/saveVersion.sh ${version}"/>
|
|
|
|
|
|
+ <arg line="src/saveVersion.sh ${version} ${build.dir}"/>
|
|
</exec>
|
|
</exec>
|
|
|
|
|
|
<exec executable="sh">
|
|
<exec executable="sh">
|
|
@@ -309,6 +310,8 @@
|
|
</exec>
|
|
</exec>
|
|
</target>
|
|
</target>
|
|
|
|
|
|
|
|
+ <import file="${test.src.dir}/aop/build/aop.xml"/>
|
|
|
|
+
|
|
<!-- ====================================================== -->
|
|
<!-- ====================================================== -->
|
|
<!-- Compile the Java files -->
|
|
<!-- Compile the Java files -->
|
|
<!-- ====================================================== -->
|
|
<!-- ====================================================== -->
|
|
@@ -548,6 +551,8 @@
|
|
<tar compression="gzip" destfile="${build.classes}/bin.tgz">
|
|
<tar compression="gzip" destfile="${build.classes}/bin.tgz">
|
|
<tarfileset dir="bin" mode="755"/>
|
|
<tarfileset dir="bin" mode="755"/>
|
|
</tar>
|
|
</tar>
|
|
|
|
+ <property name="jar.properties.list"
|
|
|
|
+ value="commons-logging.properties, log4j.properties, hadoop-metrics.properties"/>
|
|
<jar jarfile="${build.dir}/${final.name}-core.jar"
|
|
<jar jarfile="${build.dir}/${final.name}-core.jar"
|
|
basedir="${build.classes}">
|
|
basedir="${build.classes}">
|
|
<manifest>
|
|
<manifest>
|
|
@@ -557,9 +562,8 @@
|
|
<attribute name="Implementation-Vendor" value="Apache"/>
|
|
<attribute name="Implementation-Vendor" value="Apache"/>
|
|
</section>
|
|
</section>
|
|
</manifest>
|
|
</manifest>
|
|
- <fileset file="${conf.dir}/commons-logging.properties"/>
|
|
|
|
- <fileset file="${conf.dir}/log4j.properties"/>
|
|
|
|
- <fileset file="${conf.dir}/hadoop-metrics.properties"/>
|
|
|
|
|
|
+ <fileset dir="${conf.dir}" includes="${jar.properties.list}" />
|
|
|
|
+ <fileset file="${jar.extra.properties.list}" />
|
|
<zipfileset dir="${build.webapps}" prefix="webapps"/>
|
|
<zipfileset dir="${build.webapps}" prefix="webapps"/>
|
|
</jar>
|
|
</jar>
|
|
</target>
|
|
</target>
|
|
@@ -701,7 +705,7 @@
|
|
<!-- -->
|
|
<!-- -->
|
|
<!-- ================================================================== -->
|
|
<!-- ================================================================== -->
|
|
<target name="jar-test" depends="compile-core-test" description="Make hadoop-test.jar">
|
|
<target name="jar-test" depends="compile-core-test" description="Make hadoop-test.jar">
|
|
- <jar jarfile="${build.dir}/${final.name}-test.jar"
|
|
|
|
|
|
+ <jar jarfile="${build.dir}/${test.final.name}.jar"
|
|
basedir="${test.build.classes}">
|
|
basedir="${test.build.classes}">
|
|
<manifest>
|
|
<manifest>
|
|
<attribute name="Main-Class"
|
|
<attribute name="Main-Class"
|
|
@@ -715,6 +719,76 @@
|
|
</jar>
|
|
</jar>
|
|
</target>
|
|
</target>
|
|
|
|
|
|
|
|
+ <!-- ================================================================== -->
|
|
|
|
+ <!-- Fault injection customization section.
|
|
|
|
+ These targets ought to be copied over to other projects and modified
|
|
|
|
+ as needed -->
|
|
|
|
+ <!-- ================================================================== -->
|
|
|
|
+ <target name="-classes-compilation" depends="compile-core-classes,
|
|
|
|
+ compile-hdfs-classes, compile-mapred-classes, compile-core-test"/>
|
|
|
|
+ <target name="run-test-core-fault-inject" depends="injectfaults"
|
|
|
|
+ description="Run full set of the unit tests with fault injection">
|
|
|
|
+ <macro-run-tests-fault-inject target.name="test-core"
|
|
|
|
+ testcasesonly="false"/>
|
|
|
|
+ </target>
|
|
|
|
+
|
|
|
|
+ <target name="jar-test-fault-inject" depends="injectfaults"
|
|
|
|
+ description="Make hadoop-test-fi.jar">
|
|
|
|
+ <macro-jar-test-fault-inject
|
|
|
|
+ target.name="jar-test"
|
|
|
|
+ jar.final.name="test.final.name"
|
|
|
|
+ jar.final.value="${test.final.name}-fi" />
|
|
|
|
+ </target>
|
|
|
|
+
|
|
|
|
+ <target name="jar-fault-inject" depends="injectfaults"
|
|
|
|
+ description="Make hadoop-fi.jar">
|
|
|
|
+ <macro-jar-fault-inject
|
|
|
|
+ target.name="jar"
|
|
|
|
+ jar.final.name="final.name"
|
|
|
|
+ jar.final.value="${final.name}-fi" />
|
|
|
|
+ </target>
|
|
|
|
+
|
|
|
|
+ <!--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-fault-inject-with-testcaseonly" depends="injectfaults">
|
|
|
|
+ <fail unless="testcase">Can't run this target without -Dtestcase setting!
|
|
|
|
+ </fail>
|
|
|
|
+ <macro-run-tests-fault-inject target.name="test-core"
|
|
|
|
+ testcasesonly="true"/>
|
|
|
|
+ </target>
|
|
|
|
+ <!-- ================================================================== -->
|
|
|
|
+ <!-- End of Fault injection customization section -->
|
|
|
|
+ <!-- ================================================================== -->
|
|
|
|
+
|
|
|
|
+ <condition property="tests.notestcase">
|
|
|
|
+ <and>
|
|
|
|
+ <isfalse value="${test.fault.inject}"/>
|
|
|
|
+ <not>
|
|
|
|
+ <isset property="testcase"/>
|
|
|
|
+ </not>
|
|
|
|
+ </and>
|
|
|
|
+ </condition>
|
|
|
|
+ <condition property="tests.notestcase.fi">
|
|
|
|
+ <and>
|
|
|
|
+ <not>
|
|
|
|
+ <isset property="testcase" />
|
|
|
|
+ </not>
|
|
|
|
+ <istrue value="${test.fault.inject}" />
|
|
|
|
+ </and>
|
|
|
|
+ </condition>
|
|
|
|
+ <condition property="tests.testcase">
|
|
|
|
+ <and>
|
|
|
|
+ <isfalse value="${test.fault.inject}" />
|
|
|
|
+ <isset property="testcase" />
|
|
|
|
+ </and>
|
|
|
|
+ </condition>
|
|
|
|
+ <condition property="tests.testcase.fi">
|
|
|
|
+ <and>
|
|
|
|
+ <istrue value="${test.fault.inject}" />
|
|
|
|
+ <isset property="testcase" />
|
|
|
|
+ </and>
|
|
|
|
+ </condition>
|
|
<!-- ================================================================== -->
|
|
<!-- ================================================================== -->
|
|
<!-- Run unit tests -->
|
|
<!-- Run unit tests -->
|
|
<!-- ================================================================== -->
|
|
<!-- ================================================================== -->
|
|
@@ -727,6 +801,8 @@
|
|
<mkdir dir="${test.log.dir}"/>
|
|
<mkdir dir="${test.log.dir}"/>
|
|
<copy file="${test.src.dir}/hadoop-policy.xml"
|
|
<copy file="${test.src.dir}/hadoop-policy.xml"
|
|
todir="${test.build.extraconf}" />
|
|
todir="${test.build.extraconf}" />
|
|
|
|
+ <copy file="${test.src.dir}/fi-site.xml"
|
|
|
|
+ todir="${test.build.extraconf}" />
|
|
<junit showoutput="${test.output}"
|
|
<junit showoutput="${test.output}"
|
|
printsummary="${test.junit.printsummary}"
|
|
printsummary="${test.junit.printsummary}"
|
|
haltonfailure="${test.junit.haltonfailure}"
|
|
haltonfailure="${test.junit.haltonfailure}"
|
|
@@ -757,13 +833,30 @@
|
|
<propertyref name="compile.c++"/>
|
|
<propertyref name="compile.c++"/>
|
|
</syspropertyset>
|
|
</syspropertyset>
|
|
<classpath refid="${test.classpath.id}"/>
|
|
<classpath refid="${test.classpath.id}"/>
|
|
|
|
+ <syspropertyset id="FaultProbabilityProperties">
|
|
|
|
+ <propertyref regex="fi.*"/>
|
|
|
|
+ </syspropertyset>
|
|
<formatter type="${test.junit.output.format}" />
|
|
<formatter type="${test.junit.output.format}" />
|
|
- <batchtest todir="${test.build.dir}" unless="testcase">
|
|
|
|
|
|
+ <batchtest todir="${test.build.dir}" if="tests.notestcase">
|
|
<fileset dir="${test.src.dir}"
|
|
<fileset dir="${test.src.dir}"
|
|
- includes="**/${test.include}.java"
|
|
|
|
- excludes="**/${test.exclude}.java" />
|
|
|
|
|
|
+ includes="**/${test.include}.java"
|
|
|
|
+ excludes="**/${test.exclude}.java aop/**" />
|
|
</batchtest>
|
|
</batchtest>
|
|
- <batchtest todir="${test.build.dir}" if="testcase">
|
|
|
|
|
|
+ <batchtest todir="${test.build.dir}" if="tests.notestcase.fi">
|
|
|
|
+ <fileset dir="${test.src.dir}/aop"
|
|
|
|
+ includes="**/${test.include}.java"
|
|
|
|
+ excludes="**/${test.exclude}.java" />
|
|
|
|
+ </batchtest>
|
|
|
|
+ <batchtest todir="${test.build.dir}" if="tests.testcase">
|
|
|
|
+ <fileset dir="${test.src.dir}"
|
|
|
|
+ includes="**/${testcase}.java" excludes="aop/**"/>
|
|
|
|
+ </batchtest>
|
|
|
|
+ <batchtest todir="${test.build.dir}" if="tests.testcase.fi">
|
|
|
|
+ <fileset dir="${test.src.dir}/aop" includes="**/${testcase}.java"/>
|
|
|
|
+ </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="tests.testcaseonly">
|
|
<fileset dir="${test.src.dir}" includes="**/${testcase}.java"/>
|
|
<fileset dir="${test.src.dir}" includes="**/${testcase}.java"/>
|
|
</batchtest>
|
|
</batchtest>
|
|
</junit>
|
|
</junit>
|
|
@@ -783,7 +876,14 @@
|
|
</subant>
|
|
</subant>
|
|
</target>
|
|
</target>
|
|
|
|
|
|
- <target name="test" depends="test-core, test-contrib" description="Run core, contrib unit tests">
|
|
|
|
|
|
+ <target name="test" description="Run core, contrib, fault injection tests">
|
|
|
|
+ <delete file="${test.build.dir}/testsfailed"/>
|
|
|
|
+ <property name="continueOnFailure" value="true"/>
|
|
|
|
+ <antcall target="test-core"/>
|
|
|
|
+ <antcall target="test-contrib"/>
|
|
|
|
+ <antcall target="run-test-core-fault-inject"/>
|
|
|
|
+ <available file="${test.build.dir}/testsfailed" property="testsfailed"/>
|
|
|
|
+ <fail if="testsfailed">Tests failed!</fail>
|
|
</target>
|
|
</target>
|
|
|
|
|
|
<!-- Run all unit tests, not just Test*, and use non-test configuration. -->
|
|
<!-- Run all unit tests, not just Test*, and use non-test configuration. -->
|
|
@@ -1283,7 +1383,7 @@
|
|
<!-- ================================================================== -->
|
|
<!-- ================================================================== -->
|
|
<!-- Clean. Delete the build files, and their directories -->
|
|
<!-- Clean. Delete the build files, and their directories -->
|
|
<!-- ================================================================== -->
|
|
<!-- ================================================================== -->
|
|
- <target name="clean" depends="clean-contrib" description="Clean. Delete the build files, and their directories">
|
|
|
|
|
|
+ <target name="clean" depends="clean-contrib, clean-fi" description="Clean. Delete the build files, and their directories">
|
|
<delete dir="${build.dir}"/>
|
|
<delete dir="${build.dir}"/>
|
|
<delete dir="${docs.src}/build"/>
|
|
<delete dir="${docs.src}/build"/>
|
|
<delete dir="${src.docs.cn}/build"/>
|
|
<delete dir="${src.docs.cn}/build"/>
|