diff mbox

[Branch,~linaro-validation/lava-dispatcher/trunk] Rev 525: lava-test-shell: keep a copy of the results directory + consistency fix in lava-test-runner for U...

Message ID 20130111124414.4951.51003.launchpad@ackee.canonical.com
State Accepted
Headers show

Commit Message

Antonio Terceiro Jan. 11, 2013, 12:44 p.m. UTC
Merge authors:
  Antonio Terceiro (terceiro)
Related merge proposals:
  https://code.launchpad.net/~terceiro/lava-dispatcher/lava-test-shell-fixes/+merge/142391
  proposed by: Antonio Terceiro (terceiro)
------------------------------------------------------------
revno: 525 [merge]
committer: Antonio Terceiro <antonio.terceiro@linaro.org>
branch nick: trunk
timestamp: Fri 2013-01-11 09:42:30 -0300
message:
  lava-test-shell: keep a copy of the results directory + consistency fix in lava-test-runner for Ubuntu
modified:
  lava_dispatcher/actions/lava_test_shell.py
  lava_test_shell/lava-test-runner-ubuntu


--
lp:lava-dispatcher
https://code.launchpad.net/~linaro-validation/lava-dispatcher/trunk

You are subscribed to branch lp:lava-dispatcher.
To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-dispatcher/trunk/+edit-subscription
diff mbox

Patch

=== modified file 'lava_dispatcher/actions/lava_test_shell.py'
--- lava_dispatcher/actions/lava_test_shell.py	2013-01-04 13:09:27 +0000
+++ lava_dispatcher/actions/lava_test_shell.py	2013-01-09 20:57:25 +0000
@@ -103,6 +103,7 @@ 
 # After the test run has completed, the /lava/results directory is pulled over
 # to the host and turned into a bundle for submission to the dashboard.
 
+from datetime import datetime
 import glob
 import logging
 import os
@@ -563,9 +564,14 @@ 
         results_part = getattr(target.config, results_part)
         rdir = self.context.host_result_dir
 
-        with target.file_system(results_part, 'lava/results') as d:
-            bundle = lava_test_shell.get_bundle(d, testdefs_by_uuid)
-            utils.ensure_directory_empty(d)
+        with target.file_system(results_part, 'lava') as d:
+            results_dir = os.path.join(d, 'results')
+            bundle = lava_test_shell.get_bundle(results_dir, testdefs_by_uuid)
+            # lava/results must be empty, but we keep a copy named
+            # lava/results-XXXXXXXXXX for post-mortem analysis
+            timestamp = datetime.now().strftime("%s")
+            os.rename(results_dir, results_dir + '-' + timestamp)
+            os.mkdir(results_dir)
 
         signal_director.postprocess_bundle(bundle)
 

=== modified file 'lava_test_shell/lava-test-runner-ubuntu'
--- lava_test_shell/lava-test-runner-ubuntu	2012-12-19 20:54:43 +0000
+++ lava_test_shell/lava-test-runner-ubuntu	2013-01-07 20:39:13 +0000
@@ -49,7 +49,7 @@ 
 WORKFILE=${WORKFILE}-${TS}
 
 echo "${PREFIX} looking for installation work in ${WORKFILE}"
-while read line ; do
+for line in $(cat ${WORKFILE}); do
 	test=`basename $line`
 	if [ -f ${line}/install.sh ] ; then
 		echo "${PREFIX} running ${test} installer ..."
@@ -61,7 +61,7 @@ 
 			exit 1
 		fi
 	fi
-done < ${WORKFILE}
+done
 
 echo "${PREFIX} save hardware/software context info..."
 hwcontext