From patchwork Thu Jun 20 15:35:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tyler Baker X-Patchwork-Id: 18033 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 210E42397B for ; Thu, 20 Jun 2013 15:51:15 +0000 (UTC) Received: by mail-la0-f72.google.com with SMTP id fq13sf6328807lab.11 for ; Thu, 20 Jun 2013 08:51:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-beenthere:x-forwarded-to:x-forwarded-for:delivered-to :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:x-original-sender :x-original-authentication-results:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe :content-type; bh=gWxPbSavBCJweX6/eR7tLxzFJ0k/e3CBFf7cw4GCMPY=; b=nmiSsXWjUk+LzN6EgYLmktPpMMp8pIhnR3AvuJNIBiR6rjjgwSoTpxvlq6IQuMROEO Ap9sQG40J8m1zcKicd5rhX2GuIJH2g1X9lrYZlOp8+PrK7xzBd6ins3vNUb8JFACLMnQ QMDJG4IcIciJVW3ilY/ecSs6WfgTPgnpANue/DNc6Rw+FFDy/nDHj3UIMwPQuRPgcgvN af5hNqtEbF8z+dgITPvQm8QGSbO4Il0JupYTHq6VQ2oV2bGHE1ja6PoL2ryN1x3fjh6q QMdF11xnxwwNXWZVks0IvLg0vAfcTbyiUim+C0fDt94UhqMO0YjQcezhvMjXy60ZmMto jVNQ== X-Received: by 10.180.100.167 with SMTP id ez7mr49092wib.0.1371743472670; Thu, 20 Jun 2013 08:51:12 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.180.14.226 with SMTP id s2ls174394wic.13.canary; Thu, 20 Jun 2013 08:51:12 -0700 (PDT) X-Received: by 10.180.160.144 with SMTP id xk16mr13913279wib.62.1371743472387; Thu, 20 Jun 2013 08:51:12 -0700 (PDT) Received: from mail-ve0-x22a.google.com (mail-ve0-x22a.google.com [2607:f8b0:400c:c01::22a]) by mx.google.com with ESMTPS id m3si386769wiy.28.2013.06.20.08.51.11 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Jun 2013 08:51:12 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c01::22a is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c01::22a; Received: by mail-ve0-f170.google.com with SMTP id 14so5185620vea.15 for ; Thu, 20 Jun 2013 08:51:11 -0700 (PDT) X-Received: by 10.52.22.174 with SMTP id e14mr2890169vdf.21.1371743471211; Thu, 20 Jun 2013 08:51:11 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.165.8 with SMTP id yu8csp26688veb; Thu, 20 Jun 2013 08:51:10 -0700 (PDT) X-Received: by 10.194.240.201 with SMTP id wc9mr6357834wjc.1.1371743469761; Thu, 20 Jun 2013 08:51:09 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id en6si383341wib.38.2013.06.20.08.51.09 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 20 Jun 2013 08:51:09 -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; Received: from ackee.canonical.com ([91.189.89.26]) by indium.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1Uph8e-0007pj-IL for ; Thu, 20 Jun 2013 15:51:08 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id 8D1E2EA706 for ; Thu, 20 Jun 2013 15:35:18 +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: 627 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-dispatcher/trunk] Rev 627: Add Broadcom Capri support Message-Id: <20130620153518.32115.48783.launchpad@ackee.canonical.com> Date: Thu, 20 Jun 2013 15:35:18 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: list X-Generated-By: Launchpad (canonical.com); Revision="16673"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: fb0e5fd9a4eed2a912584eeb33ebf02e17c639fe X-Gm-Message-State: ALoCoQkFDoPr8zJEOvgM/4bqtUYxT9tLjOW5lZs8wH6L7THar3mPBj9dcuqN4nLDfqcHmNAgi/Z0 X-Original-Sender: noreply@launchpad.net X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c01::22a is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Merge authors: Tyler Baker (tyler-baker) Related merge proposals: https://code.launchpad.net/~tyler-baker/lava-dispatcher/capri-support/+merge/170186 proposed by: Tyler Baker (tyler-baker) review: Approve - Dave Pigott (dpigott) ------------------------------------------------------------ revno: 627 [merge] committer: Tyler Baker branch nick: lava-dispatcher timestamp: Thu 2013-06-20 08:34:19 -0700 message: Add Broadcom Capri support added: lava_dispatcher/default-config/lava-dispatcher/device-types/capri.conf lava_dispatcher/device/capri.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 === added file 'lava_dispatcher/default-config/lava-dispatcher/device-types/capri.conf' --- lava_dispatcher/default-config/lava-dispatcher/device-types/capri.conf 1970-01-01 00:00:00 +0000 +++ lava_dispatcher/default-config/lava-dispatcher/device-types/capri.conf 2013-06-18 01:41:07 +0000 @@ -0,0 +1,46 @@ +client_type = capri + +# The ADB command line. +# +# In the case where there are multiple android devices plugged into a +# single host, this connection command must be overriden on each device to +# include the serial number of the device, e.g. +# +# serial_number = XXXXXXXXXXXXXXXX +# adb_command = adb -s %(serial_number)s +adb_command = adb + +# The fastboot command. +# +# The same as above: if you have more than one device, you will want to +# override this in your device config to add a serial number, e.g. +# +# serial_number = XXXXXXXXXXXXXXXX +# fastboot_command = fastboot -s %(serial_number)s +# +# Of course, in the case you override both adb_command *and* fastboot_command, +# you don't need to specify `serial_number` twice. +fastboot_command = fastboot + +# Working directory for temporary files. By default, the usual place for LAVA +# images will be used. +# +# This is useful when the lava dispatcher is controlling the device under test which is +# physically plugged to other machines by setting adb_command to something like +# "ssh adb" and fastboot_command to something like "ssh +# fastboot". adb and fastboot always operate on local files, so +# you need your local files to also be seen as local files on the host where +# adb/fastboot are executed. +# +# In this case, you should set shared_working_directory to a shared directory +# between the machine running the dispatcher and the machine where the phone is +# plugged. This shared directory must have the same path in both machines. +# For example, you can have your /var/tmp/lava mounted at /var/tmp/lava at +# (or the other way around). +shared_working_directory = + +connection_command = %(adb_command)s shell + +enable_network_after_boot_android = false +android_adb_over_usb = true +android_adb_over_tcp = false === added file 'lava_dispatcher/device/capri.py' --- lava_dispatcher/device/capri.py 1970-01-01 00:00:00 +0000 +++ lava_dispatcher/device/capri.py 2013-06-18 19:34:56 +0000 @@ -0,0 +1,84 @@ +# Copyright (C) 2013 Linaro Limited +# +# Author: Tyler Baker +# +# This file is part of LAVA Dispatcher. +# +# LAVA Dispatcher is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# LAVA Dispatcher is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along +# with this program; if not, see . + +import logging +from lava_dispatcher.device.target import ( + Target +) +from lava_dispatcher.device.fastboot import ( + FastbootTarget +) +from lava_dispatcher.device.master import ( + MasterImageTarget +) + +class CapriTarget(FastbootTarget, MasterImageTarget): + + def __init__(self, context, config): + super(CapriTarget, self).__init__(context, config) + + def _enter_fastboot(self): + if self.fastboot.on(): + logging.debug("Device is on fastboot - no need to hard reset") + return + try: + self._soft_reboot() + self._enter_bootloader() + except: + logging.exception("_enter_bootloader failed") + self._hard_reboot() + self._enter_bootloader() + self.proc.sendline("fastboot") + + + def deploy_android(self, boot, system, userdata): + + boot = self._get_image(boot) + system = self._get_image(system) + userdata = self._get_image(userdata) + + self._enter_fastboot() + self.fastboot.flash('boot', boot) + self.fastboot.flash('system', system) + self.fastboot.flash('userdata', userdata) + + self.deployment_data = Target.android_deployment_data + self.deployment_data['boot_image'] = boot + + def power_on(self): + if not self.deployment_data.get('boot_image', False): + raise CriticalError('Deploy action must be run first') + + self._enter_fastboot() + self.fastboot('reboot') + self.proc.expect(self.context.device_config.master_str, + timeout=300) + + # The capri does not yet have adb support, so we do not wait for adb. + #self._adb('wait-for-device') + + self._booted = True + self.proc.sendline("") # required to put the adb shell in a reasonable state + self.proc.sendline("export PS1='%s'" % self.deployment_data['TESTER_PS1']) + self._runner = self._get_runner(self.proc) + + return self.proc + +target_class = CapriTarget