lttng: Use checksums to detect corrupt test traces
authorMarc-Andre Laperle <marc-andre.laperle@ericsson.com>
Wed, 3 Sep 2014 22:06:28 +0000 (18:06 -0400)
committerMarc-Andre Laperle <marc-andre.laperle@ericsson.com>
Thu, 4 Sep 2014 15:11:03 +0000 (11:11 -0400)
This also means that we don't have to delete the downloaded files every
time we clean.

Also increase the timeout for smaller traces.

Change-Id: I9807371434b1e1c5b226c444f577b44bc663c1de
Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/32825
Tested-by: Hudson CI
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
org.eclipse.linuxtools.ctf.core.tests/pom.xml
org.eclipse.linuxtools.ctf.core.tests/traces/cyg-profile.tar.bz2.md5 [new file with mode: 0644]
org.eclipse.linuxtools.ctf.core.tests/traces/django-benchmark.tar.gz.md5 [new file with mode: 0644]
org.eclipse.linuxtools.ctf.core.tests/traces/funky_trace.tar.bz2.md5 [new file with mode: 0644]
org.eclipse.linuxtools.ctf.core.tests/traces/get-traces.xml
org.eclipse.linuxtools.ctf.core.tests/traces/hello-lost.tar.bz2.md5 [new file with mode: 0644]
org.eclipse.linuxtools.ctf.core.tests/traces/kernel_vm.tar.bz2.md5 [new file with mode: 0644]
org.eclipse.linuxtools.ctf.core.tests/traces/sample-ctf-trace-20120412.tar.bz2.md5 [new file with mode: 0644]
org.eclipse.linuxtools.ctf.core.tests/traces/synctraces.tar.gz.md5 [new file with mode: 0644]
org.eclipse.linuxtools.ctf.core.tests/traces/testtraceExp.zip.md5 [new file with mode: 0644]
org.eclipse.linuxtools.ctf.core.tests/traces/trace2.tar.bz2.md5 [new file with mode: 0644]

index 826951d841dee05a432713dd98a549b4abff55f0..1324d01ef5e3c1aad004905879a39db163b604fe 100644 (file)
             <phase>clean</phase>
             <configuration>
               <filesets>
-                <fileset>
-                  <directory>traces</directory>
-                  <includes>
-                    <include>*.tar*</include>
-                  </includes>
-                  <excludes>
-                    <exclude>*.xml</exclude>
-                    <exclude>*.sh</exclude>
-                  </excludes>
-                </fileset>
                 <fileset><directory>traces/ctf-testsuite</directory></fileset>
                 <fileset><directory>traces/cyg-profile</directory></fileset>
                 <fileset><directory>traces/django-benchmark</directory></fileset>
diff --git a/org.eclipse.linuxtools.ctf.core.tests/traces/cyg-profile.tar.bz2.md5 b/org.eclipse.linuxtools.ctf.core.tests/traces/cyg-profile.tar.bz2.md5
new file mode 100644 (file)
index 0000000..3b2a1c0
--- /dev/null
@@ -0,0 +1 @@
+088795f3d7b483d197ffad51137ab39e
diff --git a/org.eclipse.linuxtools.ctf.core.tests/traces/django-benchmark.tar.gz.md5 b/org.eclipse.linuxtools.ctf.core.tests/traces/django-benchmark.tar.gz.md5
new file mode 100644 (file)
index 0000000..48a14c6
--- /dev/null
@@ -0,0 +1 @@
+afd538a1dc0c42e825292f0ce4123583
diff --git a/org.eclipse.linuxtools.ctf.core.tests/traces/funky_trace.tar.bz2.md5 b/org.eclipse.linuxtools.ctf.core.tests/traces/funky_trace.tar.bz2.md5
new file mode 100644 (file)
index 0000000..f3809d5
--- /dev/null
@@ -0,0 +1 @@
+9c68dba0f722d4c4a34791651c5b0e83
index 9d95f7d0bb2044e3aeb29dbeec151210e832c583..a62570b3edc17b92c3e2de647fb7c9104594b2db 100644 (file)
 
 <project name="Extract Traces" default="main" >
 <target name="main">
-  <echo message="Attempting to download test traces"/>
-  <get ignoreerrors="true" maxtime="60" skipexisting="true" dest="sample-ctf-trace-20120412.tar.bz2" src="http://lttng.org/files/samples/sample-ctf-trace-20120412.tar.bz2"/>
-  <get ignoreerrors="true" maxtime="60" skipexisting="true" dest="trace2.tar.bz2" src="http://www.dorsal.polymtl.ca/~alexmont/data/trace2.tar.bz2"/>
-  <get ignoreerrors="true" maxtime="20" skipexisting="true" dest="kernel_vm.tar.bz2" src="http://www.dorsal.polymtl.ca/~alexmont/data/kernel_vm.tar.bz2" />
-  <get ignoreerrors="true" maxtime="20" skipexisting="true" dest="synctraces.tar.gz" src="http://www.dorsal.polymtl.ca/~gbastien/traces/synctraces.tar.gz" />
-  <get ignoreerrors="true" maxtime="200" skipexisting="true" dest="django-benchmark.tar.gz" src="http://www.dorsal.polymtl.ca/~gbastien/traces/django-benchmark.tgz" />
-  <get ignoreerrors="true" maxtime="20" skipexisting="true" dest="hello-lost.tar.bz2" src="http://www.dorsal.polymtl.ca/~alexmont/data/hello-lost.tar.bz2" />
-  <get ignoreerrors="true" maxtime="20" skipexisting="true" dest="cyg-profile.tar.bz2" src="http://www.dorsal.polymtl.ca/~alexmont/data/cyg-profile.tar.bz2" />
-  <get ignoreerrors="true" maxtime="20" skipexisting="true" dest="funky_trace.tar.bz2" src="http://www.dorsal.polymtl.ca/~alexmont/data/funky_trace.tar.bz2" />
-  <get ignoreerrors="true" maxtime="200" skipexisting="true" dest="testtraceExp.zip" src="http://secretaire.dorsal.polymtl.ca/~mattkhouzam/testTrace-200Overlap.zip" />
+  <condition property="failedCheckSum">
+    <not>
+      <and>
+        <checksum>
+          <fileset dir="." includes="*.tar.bz2" />
+          <fileset dir="." includes="*.tar.gz" />
+          <fileset dir="." includes="*.zip" />
+        </checksum>
+      </and>
+    </not>
+  </condition>
+       
+  <antcall target="deleteFailedCheckSumTraces"/>
+  <antcall target="downloadTraceFiles"/>
   <exec executable = "git" failifexecutionfails="false" timeout="20000">
     <arg value = "clone"/>
     <arg value = "https://github.com/efficios/ctf-testsuite.git"/>
   <antcall target="extractTraces"/>
 </target>
 
+<target name="deleteFailedCheckSumTraces" if="failedCheckSum">
+  <echo message="Some traces have failed the checksum tests. Deleting traces."/>
+  <delete verbose="true">
+    <fileset dir="." includes="*.tar.bz2" />
+    <fileset dir="." includes="*.tar.gz" />
+    <fileset dir="." includes="*.zip" />
+  </delete>
+</target>
+
+<target name="warnFailedCheckSum" if="failedCheckSum2">
+  <echo message="WARNING: Some downloaded traces failed the checkum."/>
+</target>
+
+<target name="downloadTraceFiles">
+  <echo message="Attempting to download test traces"/>
+  <get ignoreerrors="true" maxtime="60" skipexisting="true" dest="sample-ctf-trace-20120412.tar.bz2" src="http://lttng.org/files/samples/sample-ctf-trace-20120412.tar.bz2"/>
+  <get ignoreerrors="true" maxtime="60" skipexisting="true" dest="trace2.tar.bz2" src="http://www.dorsal.polymtl.ca/~alexmont/data/trace2.tar.bz2"/>
+  <get ignoreerrors="true" maxtime="60" skipexisting="true" dest="kernel_vm.tar.bz2" src="http://www.dorsal.polymtl.ca/~alexmont/data/kernel_vm.tar.bz2" />
+  <get ignoreerrors="true" maxtime="60" skipexisting="true" dest="synctraces.tar.gz" src="http://www.dorsal.polymtl.ca/~gbastien/traces/synctraces.tar.gz" />
+  <get ignoreerrors="true" maxtime="200" skipexisting="true" dest="django-benchmark.tar.gz" src="http://www.dorsal.polymtl.ca/~gbastien/traces/django-benchmark.tgz" />
+  <get ignoreerrors="true" maxtime="60" skipexisting="true" dest="hello-lost.tar.bz2" src="http://www.dorsal.polymtl.ca/~alexmont/data/hello-lost.tar.bz2" />
+  <get ignoreerrors="true" maxtime="60" skipexisting="true" dest="cyg-profile.tar.bz2" src="http://www.dorsal.polymtl.ca/~alexmont/data/cyg-profile.tar.bz2" />
+  <get ignoreerrors="true" maxtime="60" skipexisting="true" dest="funky_trace.tar.bz2" src="http://www.dorsal.polymtl.ca/~alexmont/data/funky_trace.tar.bz2" />
+  <get ignoreerrors="true" maxtime="200" skipexisting="true" dest="testtraceExp.zip" src="http://secretaire.dorsal.polymtl.ca/~mattkhouzam/testTrace-200Overlap.zip" />
+</target>
+
 <target name="pullTestSuite" if="testSuiteExists">
   <exec executable = "git" failifexecutionfails="false" dir="ctf-testsuite" timeout="20000">
     <arg value = "pull"/>
 </target>
 
 <target name="extractTraces" if="tracesExist">
+    <condition property="failedCheckSum2">
+      <not>
+        <and>
+          <checksum>
+            <fileset dir="." includes="*.tar.bz2" />
+            <fileset dir="." includes="*.tar.gz" />
+            <fileset dir="." includes="*.zip" />
+          </checksum>
+        </and>
+      </not>
+    </condition>
+    <antcall target="warnFailedCheckSum"/>
     <bunzip2 src="sample-ctf-trace-20120412.tar.bz2"/>
     <bunzip2 src="trace2.tar.bz2"/>
     <bunzip2 src="kernel_vm.tar.bz2" />
diff --git a/org.eclipse.linuxtools.ctf.core.tests/traces/hello-lost.tar.bz2.md5 b/org.eclipse.linuxtools.ctf.core.tests/traces/hello-lost.tar.bz2.md5
new file mode 100644 (file)
index 0000000..d5311df
--- /dev/null
@@ -0,0 +1 @@
+4ca17df0c3e3a0dc14940a988630d2d1
diff --git a/org.eclipse.linuxtools.ctf.core.tests/traces/kernel_vm.tar.bz2.md5 b/org.eclipse.linuxtools.ctf.core.tests/traces/kernel_vm.tar.bz2.md5
new file mode 100644 (file)
index 0000000..52fd4db
--- /dev/null
@@ -0,0 +1 @@
+0aa7f55c4305e642e62c482474b937b3
diff --git a/org.eclipse.linuxtools.ctf.core.tests/traces/sample-ctf-trace-20120412.tar.bz2.md5 b/org.eclipse.linuxtools.ctf.core.tests/traces/sample-ctf-trace-20120412.tar.bz2.md5
new file mode 100644 (file)
index 0000000..d254576
--- /dev/null
@@ -0,0 +1 @@
+6b54b6b4ff7313eb7cd1edb44b39b1d3
diff --git a/org.eclipse.linuxtools.ctf.core.tests/traces/synctraces.tar.gz.md5 b/org.eclipse.linuxtools.ctf.core.tests/traces/synctraces.tar.gz.md5
new file mode 100644 (file)
index 0000000..465fb8e
--- /dev/null
@@ -0,0 +1 @@
+715e024f8b641d5cb3c5541d34ade5da
diff --git a/org.eclipse.linuxtools.ctf.core.tests/traces/testtraceExp.zip.md5 b/org.eclipse.linuxtools.ctf.core.tests/traces/testtraceExp.zip.md5
new file mode 100644 (file)
index 0000000..1c04aff
--- /dev/null
@@ -0,0 +1 @@
+6c0bffcfaee984bc70eab5bcddce4708
diff --git a/org.eclipse.linuxtools.ctf.core.tests/traces/trace2.tar.bz2.md5 b/org.eclipse.linuxtools.ctf.core.tests/traces/trace2.tar.bz2.md5
new file mode 100644 (file)
index 0000000..303fb63
--- /dev/null
@@ -0,0 +1 @@
+6971bb6f2385abdb17d017f4faaefc16
This page took 0.029686 seconds and 5 git commands to generate.