diff mbox

[Branch,~linaro-validation/lava-dispatcher/trunk] Rev 196: merge fix of disable-suspend-new branch

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

Commit Message

Yongqin Liu Jan. 19, 2012, 9:37 a.m. UTC
Merge authors:
  Yongqin Liu (liuyq0307)
Related merge proposals:
  https://code.launchpad.net/~liuyq0307/lava-dispatcher/disable-suspend-new/+merge/88985
  proposed by: Yongqin Liu (liuyq0307)
  review: Approve - Yongqin Liu (liuyq0307)
  review: Abstain - Zygmunt Krynicki (zkrynicki)
------------------------------------------------------------
revno: 196 [merge]
committer: Yongqin Liu <yongqin.liu@linaro.org>
branch nick: lava-dispatcher
timestamp: Thu 2012-01-19 17:34:46 +0800
message:
  merge fix of disable-suspend-new branch
modified:
  lava_dispatcher/client/base.py
  lava_dispatcher/default-config/lava-dispatcher/device-types/panda.conf


--
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-01-12 20:38:57 +0000
+++ lava_dispatcher/client/base.py	2012-01-19 08:59:29 +0000
@@ -59,7 +59,7 @@ 
         index = 0
         while index == 0:
             index = self._connection.expect(
-                ['.+', pexpect.EOF, pexpect.TIMEOUT], timeout=1,lava_no_logging=1)
+                ['.+', pexpect.EOF, pexpect.TIMEOUT], timeout=1, lava_no_logging=1)
 
     def run(self, cmd, response=None, timeout=-1):
         """Run `cmd` and wait for a shell response.
@@ -126,7 +126,7 @@ 
     def wait_network_up(self, timeout=300):
         """Wait until the networking is working."""
         now = time.time()
-        while time.time() < now+timeout:
+        while time.time() < now + timeout:
             if self._check_network_up():
                 return
         raise NetworkError
@@ -230,7 +230,7 @@ 
     def wait_home_screen(self):
         cmd = 'getprop init.svc.bootanim'
         for count in range(100):
-            self.run(cmd, response='stopped', timeout=5)
+            self.run(cmd, response=['stopped', pexpect.TIMEOUT], timeout=5)
             if self.match_id == 0:
                 return True
             time.sleep(1)
@@ -403,16 +403,30 @@ 
         if self.config.get("enable_network_after_boot_android"):
             time.sleep(1)
             self._enable_network()
-            
+
         self._enable_adb_over_tcpip()
+        self._disable_suspend()
+
+    def _disable_suspend(self):
+        """ disable the suspend of images. 
+        this needs wait unitl the home screen displayed"""
+        session = AndroidTesterCommandRunner(self)
+        session.wait_home_screen()
+        stay_awake = "delete from system where name='stay_on_while_plugged_in'; insert into system (name, value) values ('stay_on_while_plugged_in','3');"
+        screen_sleep = "delete from system where name='screen_off_timeout'; insert into system (name, value) values ('screen_off_timeout','-1');"
+        lockscreen = "delete from secure where name='lockscreen.disabled'; insert into secure (name, value) values ('lockscreen.disabled','1');"
+        session.run('sqlite3 /data/data/com.android.providers.settings/databases/settings.db "%s"' % (stay_awake)) ## set stay awake
+        session.run('sqlite3 /data/data/com.android.providers.settings/databases/settings.db "%s"' % (screen_sleep)) ## set sleep to none
+        session.run('sqlite3 /data/data/com.android.providers.settings/databases/settings.db "%s"' % (lockscreen)) ##set lock screen to none
+        session.run('input keyevent 82')  ##unlock the home screen
+        session.run('service call power 1 i32 26') ##acquireWakeLock FULL_WAKE_LOCK
 
     def _enable_network(self):
-        network_interface = self.default_network_interface
         session = TesterCommandRunner(self, wait_for_rc=False)
         session.run("netcfg", timeout=20)
-        session.run("netcfg %s up"%self.default_network_interface, timeout=20)
-        session.run("netcfg %s dhcp"%self.default_network_interface, timeout=300)
-        session.run("ifconfig " +  self.default_network_interface, timeout=20)
+        session.run("netcfg %s up" % self.default_network_interface, timeout=20)
+        session.run("netcfg %s dhcp" % self.default_network_interface, timeout=300)
+        session.run("ifconfig " + self.default_network_interface, timeout=20)
 
 
     def _enable_adb_over_tcpip(self):

=== modified file 'lava_dispatcher/default-config/lava-dispatcher/device-types/panda.conf'
--- lava_dispatcher/default-config/lava-dispatcher/device-types/panda.conf	2011-09-19 10:17:10 +0000
+++ lava_dispatcher/default-config/lava-dispatcher/device-types/panda.conf	2012-01-18 07:41:42 +0000
@@ -14,5 +14,5 @@ 
     setenv bootargs "'console=tty0 console=ttyO2,115200n8 
     rootwait rw earlyprintk fixrtc nocompcache vram=48M 
     omapfb.vram=0:24M,1:24M mem=456M@0x80000000 mem=512M@0xA0000000 
-    init=/init androidboot.console=ttyO2'",
+    init=/init androidboot.console=ttyO2 no_console_suspend'",
     boot