From patchwork Thu Jul 12 02:27:13 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yongqin Liu X-Patchwork-Id: 9950 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 3B8B723E57 for ; Thu, 12 Jul 2012 02:27:18 +0000 (UTC) Received: from mail-yw0-f52.google.com (mail-yw0-f52.google.com [209.85.213.52]) by fiordland.canonical.com (Postfix) with ESMTP id E42C1A18504 for ; Thu, 12 Jul 2012 02:27:17 +0000 (UTC) Received: by yhpp61 with SMTP id p61so2246471yhp.11 for ; Wed, 11 Jul 2012 19:27:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf :content-type:mime-version:x-launchpad-project:x-launchpad-branch :x-launchpad-message-rationale:x-launchpad-branch-revision-number :x-launchpad-notification-type:to:from:subject:message-id:date :reply-to:sender:errors-to:precedence:x-generated-by :x-launchpad-hash:x-gm-message-state; bh=9TwT0WDzAR/S5sIzFXShWURQNMHFJCWx2rYbe5o1Xm8=; b=Ca4aKFS1hjwkTl6XJpc19+tf9oDS0sY1cm3em2LuzqfIXBhDiEdDrF8FKBlskTh9Kv siDCz9IqcmkO/IXCtqEyL7Q7bsneoJn2uZ9OVPrGKS/XHJLu6le1JjxIrmJ29I6Dwmnf 0YBjDS7r5x77BD5He6xTCGSwdwWfYzn0xOme25VhrT2MW2BAjBiMecHfbY+GftMln+Wj rr8Q2wMXsoSGdTZvWVN8m41R/9wzptCpR67rPfmVGnDUXqaMqOz8QS9GLCDwjaNhbguQ 47TKZtSO1/hZ1o2bdo2VxmFHMmO1Zk+PugBxcgQDcxKktstBSU9rQ2YElf0EHerogEkU Pf8Q== Received: by 10.42.155.73 with SMTP id t9mr26587512icw.48.1342060036941; Wed, 11 Jul 2012 19:27:16 -0700 (PDT) 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.231.241.2 with SMTP id lc2csp195ibb; Wed, 11 Jul 2012 19:27:15 -0700 (PDT) Received: by 10.216.182.210 with SMTP id o60mr524519wem.110.1342060034670; Wed, 11 Jul 2012 19:27:14 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id bc6si44246690wib.6.2012.07.11.19.27.14 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 11 Jul 2012 19:27:14 -0700 (PDT) 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 1Sp97a-00022X-0Q for ; Thu, 12 Jul 2012 02:27:14 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id E7FDEE0180 for ; Thu, 12 Jul 2012 02:27:13 +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: 347 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-dispatcher/trunk] Rev 347: merge with the branch that changing to use the disablesuspend.sh in android Message-Id: <20120712022713.19738.63714.launchpad@ackee.canonical.com> Date: Thu, 12 Jul 2012 02:27:13 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="15593"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: a917d24843f4f02d60e3611f76b2e81573aeccee X-Gm-Message-State: ALoCoQmOvovyy/KenSgxytQZbZFXJkRRsE8lR0NzHviDn9KEHHXHr0wMxOR3Ad7E7wvxbwNgcUp/ Merge authors: Yongqin Liu (liuyq0307) Related merge proposals: https://code.launchpad.net/~liuyq0307/lava-dispatcher/use-disablesuspend-sh/+merge/114087 proposed by: Yongqin Liu (liuyq0307) review: Approve - Yongqin Liu (liuyq0307) ------------------------------------------------------------ revno: 347 [merge] committer: Yongqin Liu branch nick: lava-dispatcher timestamp: Thu 2012-07-12 10:25:57 +0800 message: merge with the branch that changing to use the disablesuspend.sh in android modified: lava_dispatcher/client/base.py lava_dispatcher/client/fastmodel.py lava_dispatcher/client/master.py lava_dispatcher/default-config/lava-dispatcher/device-defaults.conf lava_dispatcher/default-config/lava-dispatcher/device-types/fastmodel.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-06-27 09:13:53 +0000 +++ lava_dispatcher/client/base.py 2012-07-04 03:38:44 +0000 @@ -457,15 +457,7 @@ else: logging.info("Skip raising exception on the home screen has not displayed for health check jobs") - 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 - #unlock the home screen 240: for fastmodels, 120 failed, 180 failed some - session.run('input keyevent 82', timeout=240) - session.run('service call power 1 i32 26') ##acquireWakeLock FULL_WAKE_LOCK + session.run('/system/bin/disablesuspend.sh') def _enable_network(self): session = TesterCommandRunner(self, wait_for_rc=False) === modified file 'lava_dispatcher/client/fastmodel.py' --- lava_dispatcher/client/fastmodel.py 2012-07-09 23:11:59 +0000 +++ lava_dispatcher/client/fastmodel.py 2012-07-12 02:25:57 +0000 @@ -49,13 +49,15 @@ PORT_PATTERN = 'terminal_0: Listening for serial connection on port (\d+)' ANDROID_WALLPAPER = 'system/wallpaper_info.xml' - SYS_PARTITION = 2 + SYS_PARTITION = 2 DATA_PARTITION = 5 def __init__(self, context, config): super(LavaFastModelClient, self).__init__(context, config) self._sim_binary = config.get('simulator_binary', None) lic_server = config.get('license_server', None) + self.git_url_disablesuspend_sh = config.get('git_url_disablesuspend_sh', + None) if not self._sim_binary or not lic_server: raise RuntimeError("The device type config for this device " "requires settings for 'simulator_binary' and 'license_server'") @@ -73,12 +75,20 @@ logging_system('sudo rm -f %s' % wallpaper) with image_partition_mounted(self._sd_image, self.SYS_PARTITION) as d: + script_path = '%s/%s' % (d, '/system/bin/disablesuspend.sh') + if self.git_url_disablesuspend_sh: + logging_system('sudo wget %s -O %s' % ( + self.git_url_disablesuspend_sh, + script_path)) + logging_system('sudo chmod +x %s' % script_path) + logging_system('sudo chown :2000 %s' % script_path) + #make sure PS1 is what we expect it to be logging_system( 'sudo sh -c \'echo "PS1=%s ">> %s/etc/mkshrc\'' % (self.tester_str, d)) # fast model usermode networking does not support ping logging_system( - 'sudo sh -c \'echo "alias ping=\\\"echo LAVA-ping override 1 received\\\"">> %s/etc/mkshrc\'' %d) + 'sudo sh -c \'echo "alias ping=\\\"echo LAVA-ping override 1 received\\\"">> %s/etc/mkshrc\'' % d) def _customize_ubuntu(self): with image_partition_mounted(self._sd_image, self.root_part) as mntdir: @@ -111,7 +121,7 @@ with image_partition_mounted(self._sd_image, self.boot_part) as mntdir: src = '%s/linux-system-ISW.axf' % mntdir self._axf = \ - '%s/%s' % (os.path.dirname(self._system),os.path.split(src)[1]) + '%s/%s' % (os.path.dirname(self._system), os.path.split(src)[1]) shutil.copyfile(src, self._axf) self._customize_android() === modified file 'lava_dispatcher/client/master.py' --- lava_dispatcher/client/master.py 2012-07-06 01:47:32 +0000 +++ lava_dispatcher/client/master.py 2012-07-10 02:23:04 +0000 @@ -220,7 +220,8 @@ _deploy_tarball_to_board(session, systemtbz2, '/mnt/lava', timeout=600) if session.has_partition_with_label('userdata') and \ - session.has_partition_with_label('sdcard'): + session.has_partition_with_label('sdcard') and \: + session.is_file_exist('/mnt/lava/system/etc/vold.fstab'): # If there is no userdata partition on the sdcard(like iMX and Origen), # then the sdcard partition will be used as the userdata partition as # before, and so cannot be used here as the sdcard on android @@ -229,12 +230,25 @@ "/mnt/sdcard %s /devices/platform/omap/omap_hsmmc.0/" "mmc_host/mmc0") % sdcard_part_lava session.run( - 'sed -i "%s" /mnt/lava/system/etc/vold.fstab' % sed_cmd) + 'sed -i "%s" /mnt/lava/system/etc/vold.fstab' % sed_cmd, + failok=True) + + script_path = '%s/%s' % ('/mnt/lava', '/system/bin/disablesuspend.sh') + if not session.is_file_exist(script_path): + git_url = session._client.device_option("git_url_disablesuspend_sh") + lava_proxy = session._client.context.lava_proxy + session.run("sh -c 'export http_proxy=%s'" % lava_proxy) + session.run('wget %s -O %s' % (git_url, script_path)) + session.run('chmod +x %s' % script_path) + session.run('chown :2000 %s' % script_path) + session.run( 'sed -i "s/^PS1=.*$/PS1=\'root@linaro: \'/" /mnt/lava/system/etc/mkshrc', failok=True) + session.run('umount /mnt/lava/system') + def _purge_linaro_android_sdcard(session): logging.info("Reformatting Linaro Android sdcard filesystem") session.run('mkfs.vfat /dev/disk/by-label/sdcard -n sdcard') @@ -305,8 +319,12 @@ if not label: return False - cmd = 'ls /dev/disk/by-label/%s' % label - rc = self.run(cmd, timeout=2, failok=True) + path = '/dev/disk/by-label/%s' % label + return self.is_file_exist(path) + + def is_file_exist(self, path): + cmd = 'ls %s' % path + rc = self.run(cmd, failok=True) if rc == 0: return True return False === modified file 'lava_dispatcher/default-config/lava-dispatcher/device-defaults.conf' --- lava_dispatcher/default-config/lava-dispatcher/device-defaults.conf 2012-07-02 07:01:52 +0000 +++ lava_dispatcher/default-config/lava-dispatcher/device-defaults.conf 2012-07-07 05:37:29 +0000 @@ -113,3 +113,6 @@ # This is for android build where the network is not up by default. 1 or 0 enable_network_after_boot_android = 1 +# the url of disablesusepend.sh script in android git repository +git_url_disablesuspend_sh = "http://android.git.linaro.org/gitweb?p=device/linaro/common.git;a=blob_plain;f=disablesuspend.sh;hb=refs/heads/linaro-ics" + === modified file 'lava_dispatcher/default-config/lava-dispatcher/device-types/fastmodel.conf' --- lava_dispatcher/default-config/lava-dispatcher/device-types/fastmodel.conf 2012-06-15 20:37:40 +0000 +++ lava_dispatcher/default-config/lava-dispatcher/device-types/fastmodel.conf 2012-07-10 02:42:13 +0000 @@ -3,3 +3,6 @@ # The license server must also be specified. eg: #license_server = 8224@192.168.1.10 + +# the url of disablesusepend.sh script in android git repository +git_url_disablesuspend_sh = "http://android.git.linaro.org/gitweb?p=device/linaro/common.git;a=blob_plain;f=disablesuspend.sh;hb=refs/heads/linaro-ics"