diff mbox

[Branch,~linaro-validation/lava-dispatcher/trunk] Rev 112: Merge fixes for:

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

Commit Message

Paul Larson Sept. 16, 2011, 2:40 a.m. UTC
Merge authors:
  Spring Zhang (qzhang)
Related merge proposals:
  https://code.launchpad.net/~qzhang/lava-dispatcher/fix-844299-844301-844462/+merge/75124
  proposed by: Spring Zhang (qzhang)
  review: Approve - Paul Larson (pwlars)
------------------------------------------------------------
revno: 112 [merge]
committer: Paul Larson <paul.larson@canonical.com>
branch nick: big-dispatcher-merge
timestamp: Thu 2011-09-15 21:37:57 -0500
message:
  Merge fixes for:
     Bug #844299: dispatcher detects failure to install lava-test, still tries to run tests
     Bug #844301: dispatcher didn't detect deployment failure
     Bug #844462: Failing to boot the image should be a critical error
modified:
  lava_dispatcher/actions/boot_control.py
  lava_dispatcher/actions/deploy.py
  lava_dispatcher/actions/lava-test.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/actions/boot_control.py'
--- lava_dispatcher/actions/boot_control.py	2011-06-27 04:55:08 +0000
+++ lava_dispatcher/actions/boot_control.py	2011-09-16 02:37:57 +0000
@@ -21,6 +21,7 @@ 
 # with this program; if not, see <http://www.gnu.org/licenses>.
 
 from lava_dispatcher.actions import BaseAction, BaseAndroidAction
+from lava_dispatcher.client import CriticalError
 
 class cmd_boot_linaro_android_image(BaseAndroidAction):
     """ Call client code to boot to the master image
@@ -29,10 +30,13 @@ 
         #Workaround for commands coming too quickly at this point
         client = self.client
         client.proc.sendline("")
-        client.boot_linaro_android_image()
+        try:
+            client.boot_linaro_android_image()
+        except:
+            raise CriticalError("Failed to boot test image.")
 
 class cmd_boot_linaro_image(BaseAction):
-    """ Call client code to boot to the master image
+    """ Call client code to boot to the test image
     """
     def run(self):
         client = self.client
@@ -43,7 +47,7 @@ 
             client.boot_linaro_image()
         except:
             status = 'fail'
-            raise
+            raise CriticalError("Failed to boot test image.")
         finally:
             self.context.test_data.add_result("boot_image", status)
 

=== modified file 'lava_dispatcher/actions/deploy.py'
--- lava_dispatcher/actions/deploy.py	2011-09-15 08:39:32 +0000
+++ lava_dispatcher/actions/deploy.py	2011-09-16 02:37:57 +0000
@@ -170,9 +170,13 @@ 
         client.run_cmd_master('udevadm trigger')
         client.run_cmd_master('mkdir -p /mnt/root')
         client.run_cmd_master('mount /dev/disk/by-label/testrootfs /mnt/root')
-        client.run_cmd_master(
+        rc = client.run_cmd_master(
             'wget -qO- %s |tar --numeric-owner -C /mnt/root -xzf -' % rootfs,
             timeout=3600)
+        if rc != 0:
+            msg = "Deploy test rootfs partition: failed to download tarball."
+            raise OperationFailed(msg)
+
         client.run_cmd_master('echo linaro > /mnt/root/etc/hostname')
         #DO NOT REMOVE - diverting flash-kernel and linking it to /bin/true
         #prevents a serious problem where packages getting installed that
@@ -191,8 +195,11 @@ 
         client.run_cmd_master('udevadm trigger')
         client.run_cmd_master('mkdir -p /mnt/boot')
         client.run_cmd_master('mount /dev/disk/by-label/testboot /mnt/boot')
-        client.run_cmd_master(
+        rc = client.run_cmd_master(
             'wget -qO- %s |tar --numeric-owner -C /mnt/boot -xzf -' % bootfs)
+        if rc != 0:
+            msg = "Deploy test boot partition: failed to download tarball."
+            raise OperationFailed(msg)
         client.run_cmd_master('umount /mnt/boot')
 
     def refresh_hwpack(self, kernel_matrix, hwpack, use_cache=True):

=== modified file 'lava_dispatcher/actions/lava-test.py'
--- lava_dispatcher/actions/lava-test.py	2011-09-14 16:05:43 +0000
+++ lava_dispatcher/actions/lava-test.py	2011-09-16 02:37:57 +0000
@@ -23,9 +23,7 @@ 
 from datetime import datetime
 import traceback
 from lava_dispatcher.actions import BaseAction
-from lava_dispatcher.client import OperationFailed
-
-
+from lava_dispatcher.client import OperationFailed, CriticalError
 
 def _setup_testrootfs(client):
     #Make sure in master image
@@ -54,7 +52,6 @@ 
     client.run_cmd_master('umount /mnt/root')
 
 
-
 def _install_lava_test(client):
     #install bazaar in tester image
     client.run_cmd_master(
@@ -75,7 +72,7 @@ 
     except:
         tb = traceback.format_exc()
         client.sio.write(tb)
-        raise OperationFailed("lava-test deployment failed")
+        raise CriticalError("lava-test deployment failed")
 
 
 class cmd_lava_test_run(BaseAction):