From patchwork Thu Oct 20 04:12:13 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael-Doyle Hudson X-Patchwork-Id: 4742 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 C3C0F23DEF for ; Thu, 20 Oct 2011 04:12:16 +0000 (UTC) Received: from mail-bw0-f52.google.com (mail-bw0-f52.google.com [209.85.214.52]) by fiordland.canonical.com (Postfix) with ESMTP id A76BAA1809F for ; Thu, 20 Oct 2011 04:12:16 +0000 (UTC) Received: by bkbzs2 with SMTP id zs2so4276030bkb.11 for ; Wed, 19 Oct 2011 21:12:16 -0700 (PDT) Received: by 10.223.17.3 with SMTP id q3mr15582349faa.28.1319083935071; Wed, 19 Oct 2011 21:12:15 -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.152.1.71 with SMTP id 7cs106649lak; Wed, 19 Oct 2011 21:12:14 -0700 (PDT) Received: by 10.216.163.194 with SMTP id a44mr3393228wel.1.1319083933440; Wed, 19 Oct 2011 21:12:13 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id u82si6012087weq.136.2011.10.19.21.12.13 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 19 Oct 2011 21:12:13 -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 1RGjzJ-0006d4-4R for ; Thu, 20 Oct 2011 04:12:13 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id 141A1E01C7 for ; Thu, 20 Oct 2011 04:12: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: 139 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-dispatcher/trunk] Rev 139: move the selection of which character the boot loader uses on a board into the device config Message-Id: <20111020041213.20107.79038.launchpad@ackee.canonical.com> Date: Thu, 20 Oct 2011 04:12: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="14165"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: 59cf6df372614723b1cdca82bd62e8e7a4d6a29a Merge authors: Michael Hudson-Doyle (mwhudson) Related merge proposals: https://code.launchpad.net/~mwhudson/lava-dispatcher/uboot-prompt-config/+merge/79904 proposed by: Michael Hudson-Doyle (mwhudson) review: Approve - Paul Larson (pwlars) ------------------------------------------------------------ revno: 139 [merge] committer: Michael Hudson-Doyle branch nick: trunk timestamp: Thu 2011-10-20 17:10:50 +1300 message: move the selection of which character the boot loader uses on a board into the device config modified: lava_dispatcher/android_client.py lava_dispatcher/client.py lava_dispatcher/default-config/lava-dispatcher/device-defaults.conf lava_dispatcher/default-config/lava-dispatcher/device-types/mx51evk.conf lava_dispatcher/default-config/lava-dispatcher/device-types/mx53loco.conf lava_dispatcher/default-config/lava-dispatcher/device-types/snowball.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/android_client.py' --- lava_dispatcher/android_client.py 2011-10-18 02:38:34 +0000 +++ lava_dispatcher/android_client.py 2011-10-20 04:09:15 +0000 @@ -17,15 +17,18 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, see . +import logging +import os import pexpect +import re import sys -import os import time + +from tempfile import mkdtemp + from lava_dispatcher.client import LavaClient, OperationFailed, NetworkError, GeneralError -import logging +from lava_dispatcher.utils import string_to_list -from utils import string_to_list -from tempfile import mkdtemp class LavaAndroidClient(LavaClient): def __init__(self, context, config): @@ -64,10 +67,11 @@ logging.exception('enter_uboot failed') self.hard_reboot() self.enter_uboot() + bootloader_prompt = re.escape(self.device_option('bootloader_prompt')) boot_cmds = string_to_list(self.config.get('boot_cmds_android')) self.proc.sendline(boot_cmds[0]) for line in range(1, len(boot_cmds)): - self.proc.expect("#") + self.proc.expect(bootloader_prompt) self.proc.sendline(boot_cmds[line]) self.in_test_shell() self.proc.sendline("export PS1=\"root@linaro: \"") === modified file 'lava_dispatcher/client.py' --- lava_dispatcher/client.py 2011-10-18 02:38:34 +0000 +++ lava_dispatcher/client.py 2011-10-20 04:09:15 +0000 @@ -19,6 +19,7 @@ # with this program; if not, see . import pexpect +import re import sys import time from cStringIO import StringIO @@ -117,13 +118,9 @@ self.enter_uboot() boot_cmds = self.boot_cmds self.proc.sendline(boot_cmds[0]) + bootloader_prompt = re.escape(self.device_option('bootloader_prompt')) for line in range(1, len(boot_cmds)): - if self.device_type in ["mx51evk", "mx53loco"]: - self.proc.expect(">", timeout=300) - elif self.device_type == "snowball_sd": - self.proc.expect("\$", timeout=300) - else: - self.proc.expect("#", timeout=300) + self.proc.expect(bootloader_prompt, timeout=300) self.proc.sendline(boot_cmds[line]) self.in_test_shell() # set PS1 to include return value of last command === modified file 'lava_dispatcher/default-config/lava-dispatcher/device-defaults.conf' --- lava_dispatcher/default-config/lava-dispatcher/device-defaults.conf 2011-09-09 04:34:34 +0000 +++ lava_dispatcher/default-config/lava-dispatcher/device-defaults.conf 2011-10-20 04:09:15 +0000 @@ -48,3 +48,6 @@ # Test image recognization string TESTER_STR = root@linaro: + +# The character the boot loader uses as a prompt on this board. +bootloader_prompt = # === modified file 'lava_dispatcher/default-config/lava-dispatcher/device-types/mx51evk.conf' --- lava_dispatcher/default-config/lava-dispatcher/device-types/mx51evk.conf 2011-09-07 03:46:15 +0000 +++ lava_dispatcher/default-config/lava-dispatcher/device-types/mx51evk.conf 2011-10-20 04:09:15 +0000 @@ -8,3 +8,4 @@ setenv bootargs "' console=tty0 console=ttymxc0,115200n8 root=LABEL=testrootfs rootwait ro'", boot +bootloader_prompt = > === modified file 'lava_dispatcher/default-config/lava-dispatcher/device-types/mx53loco.conf' --- lava_dispatcher/default-config/lava-dispatcher/device-types/mx53loco.conf 2011-09-07 03:46:15 +0000 +++ lava_dispatcher/default-config/lava-dispatcher/device-types/mx53loco.conf 2011-10-20 04:09:15 +0000 @@ -7,3 +7,4 @@ setenv bootargs "' console=tty0 console=ttymxc0,115200n8 root=LABEL=testrootfs rootwait ro'", boot +bootloader_prompt = > === modified file 'lava_dispatcher/default-config/lava-dispatcher/device-types/snowball.conf' --- lava_dispatcher/default-config/lava-dispatcher/device-types/snowball.conf 2011-09-07 03:46:15 +0000 +++ lava_dispatcher/default-config/lava-dispatcher/device-types/snowball.conf 2011-10-20 04:09:15 +0000 @@ -9,4 +9,5 @@ hwmem=48M@302M mem=152M@360M'", boot -#boot_cmds_android = TBD \ No newline at end of file +#boot_cmds_android = TBD +bootloader_prompt = $