diff mbox

[Branch,~linaro-validation/lava-dispatcher/trunk] Rev 495: improve some android boot logic and options

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

Commit Message

Andy Doan Dec. 13, 2012, 10:22 p.m. UTC
------------------------------------------------------------
revno: 495
committer: Andy Doan <andy.doan@linaro.org>
branch nick: android-fixes
timestamp: Thu 2012-12-13 14:02:55 -0600
message:
  improve some android boot logic and options
  
  not all android devices want the coming up of the home screen to
  be counted as a good boot. So this adds a config option to make
  waiting for the home screen optional. Additionally, I noticed we wait
  for the homescreen when establishing a tester session which makes no
  sense since you've already done that waiting.
  
  Lastly, I made the number of loops to wait for home screen configurable
  in case someone gets the urge to increase/decrease for their device
modified:
  lava_dispatcher/client/base.py
  lava_dispatcher/config.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/client/base.py'
--- lava_dispatcher/client/base.py	2012-12-05 14:47:46 +0000
+++ lava_dispatcher/client/base.py	2012-12-13 20:02:55 +0000
@@ -253,8 +253,9 @@ 
 
     def wait_home_screen(self):
         cmd = 'getprop init.svc.bootanim'
-        for count in range(100):
-            logging.debug("Waiting for home screen (%d/100)" % count)
+        tries = self._client.config.android_home_screen_tries
+        for count in range(tries):
+            logging.debug("Waiting for home screen (%d/%d)", count, tries)
             try:
                 self.run(cmd, response=['stopped'], timeout=5)
                 if self.match_id == 0:
@@ -339,14 +340,7 @@ 
             pass
         session.android_adb_connect(dev_ip)
         session.wait_until_attached()
-        try:
-            session.wait_home_screen()
-        except:
-            # ignore home screen exception if it is a health check job.
-            if not (self.context.job_data.has_key("health_check") and self.context.job_data["health_check"] == True):
-                raise
-            else:
-                logging.info("Skip raising exception on the home screen has not displayed for health check jobs")
+        
         try:
             yield session
         finally:
@@ -446,7 +440,8 @@ 
         this needs wait unitl the home screen displayed"""
         session = AndroidTesterCommandRunner(self)
         try:
-            session.wait_home_screen()
+            if self.config.android_wait_for_home_screen:
+                session.wait_home_screen()
         except:
             # ignore home screen exception if it is a health check job.
             if not (self.context.job_data.has_key("health_check") and self.context.job_data["health_check"] == True):

=== modified file 'lava_dispatcher/config.py'
--- lava_dispatcher/config.py	2012-12-05 14:47:46 +0000
+++ lava_dispatcher/config.py	2012-12-13 20:02:55 +0000
@@ -74,9 +74,11 @@ 
     simulator_command = schema.StringOption()
     simulator_axf_files = schema.ListOption()
 
-    android_disable_suspend = schema.BoolOption(default = True)
-    android_adb_over_usb = schema.BoolOption(default = False)
-    android_adb_over_tcp = schema.BoolOption(default = True)
+    android_disable_suspend = schema.BoolOption(default=True)
+    android_adb_over_usb = schema.BoolOption(default=False)
+    android_adb_over_tcp = schema.BoolOption(default=True)
+    android_wait_for_home_screen = schema.BoolOption(default=True)
+    android_home_screen_tries = schema.IntOption(default=100)
 
 
 class OptionDescriptor(object):