diff mbox

[Branch,~linaro-validation/lava-dispatcher/trunk] Rev 511: fix aep and shell hooks signal hander post-processing logic

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

Commit Message

Andy Doan Dec. 20, 2012, 4:31 p.m. UTC
------------------------------------------------------------
revno: 511
committer: Andy Doan <andy.doan@linaro.org>
branch nick: trunk
timestamp: Wed 2012-12-19 21:35:44 -0600
message:
  fix aep and shell hooks signal hander post-processing logic
  
  revno 507 left out the part of shellhooks logic that ensured the
  test case id would be preserved. This does the same thing w/o
  requiring the extra call to os.mkdir
modified:
  lava_dispatcher/lava_test_shell.py
  lava_dispatcher/signals/__init__.py


--
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/lava_test_shell.py'
--- lava_dispatcher/lava_test_shell.py	2012-12-04 22:20:34 +0000
+++ lava_dispatcher/lava_test_shell.py	2012-12-20 03:35:44 +0000
@@ -169,9 +169,11 @@ 
         w(path, attrvalue)
 
 
-def _result_from_dir(dir):
+def _result_from_dir(dir, test_case_id=None):
+    if not test_case_id:
+        test_case_id = os.path.basename(dir)
     result = {
-        'test_case_id': os.path.basename(dir),
+        'test_case_id': test_case_id
         }
 
     for fname in 'result', 'measurement', 'units', 'message', 'timestamp', 'duration':

=== modified file 'lava_dispatcher/signals/__init__.py'
--- lava_dispatcher/signals/__init__.py	2012-12-19 04:27:40 +0000
+++ lava_dispatcher/signals/__init__.py	2012-12-20 03:35:44 +0000
@@ -105,10 +105,11 @@ 
         scratch_dir = self.testdef_obj.context.client.target_device.scratch_dir
         rdir = tempfile.mkdtemp(dir=scratch_dir)
         try:
+            tcid = test_result['test_case_id']
             _result_to_dir(test_result, rdir)
             yield rdir
             test_result.clear()
-            test_result.update(_result_from_dir(rdir))
+            test_result.update(_result_from_dir(rdir, tcid))
         finally:
             rmtree(rdir)