From patchwork Thu Jan 19 09:37:12 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yongqin Liu X-Patchwork-Id: 6291 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 2280323F8D for ; Thu, 19 Jan 2012 09:37:16 +0000 (UTC) Received: from mail-bk0-f52.google.com (mail-bk0-f52.google.com [209.85.214.52]) by fiordland.canonical.com (Postfix) with ESMTP id 04716A18361 for ; Thu, 19 Jan 2012 09:37:15 +0000 (UTC) Received: by bkbzt4 with SMTP id zt4so4041218bkb.11 for ; Thu, 19 Jan 2012 01:37:15 -0800 (PST) Received: by 10.204.10.73 with SMTP id o9mr4296367bko.99.1326965834916; Thu, 19 Jan 2012 01:37:14 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.205.82.144 with SMTP id ac16cs4248bkc; Thu, 19 Jan 2012 01:37:14 -0800 (PST) Received: by 10.180.73.72 with SMTP id j8mr32040235wiv.2.1326965833280; Thu, 19 Jan 2012 01:37:13 -0800 (PST) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id l55si7699444weq.14.2012.01.19.01.37.13 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 19 Jan 2012 01:37:13 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) client-ip=91.189.90.7; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) smtp.mail=bounces@canonical.com Received: from ackee.canonical.com ([91.189.89.26]) by indium.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1RnoQj-000498-1U for ; Thu, 19 Jan 2012 09:37:13 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id F156AE01A0 for ; Thu, 19 Jan 2012 09:37:12 +0000 (UTC) MIME-Version: 1.0 X-Launchpad-Project: lava-dispatcher X-Launchpad-Branch: ~linaro-validation/lava-dispatcher/trunk X-Launchpad-Message-Rationale: Subscriber X-Launchpad-Branch-Revision-Number: 196 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-dispatcher/trunk] Rev 196: merge fix of disable-suspend-new branch Message-Id: <20120119093712.25114.23032.launchpad@ackee.canonical.com> Date: Thu, 19 Jan 2012 09:37:12 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="14692"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: 0db377d4f52c869dc6a6aee1aa2ffbee8587bd08 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 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 === 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