From patchwork Thu Oct 20 06:42: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: 4743 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 22E4523DEF for ; Thu, 20 Oct 2011 06:42:16 +0000 (UTC) Received: from mail-ey0-f180.google.com (mail-ey0-f180.google.com [209.85.215.180]) by fiordland.canonical.com (Postfix) with ESMTP id 10F7CA180D7 for ; Thu, 20 Oct 2011 06:42:16 +0000 (UTC) Received: by eyg5 with SMTP id 5so3199056eyg.11 for ; Wed, 19 Oct 2011 23:42:15 -0700 (PDT) Received: by 10.223.85.139 with SMTP id o11mr16419201fal.0.1319092935704; Wed, 19 Oct 2011 23:42: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 7cs110376lak; Wed, 19 Oct 2011 23:42:15 -0700 (PDT) Received: by 10.216.133.12 with SMTP id p12mr7832418wei.99.1319092934329; Wed, 19 Oct 2011 23:42:14 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id v52si6204689wec.144.2011.10.19.23.42.14 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 19 Oct 2011 23:42: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 1RGmKT-0002oQ-UG for ; Thu, 20 Oct 2011 06:42:13 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id D9BDBF5FC8 for ; Thu, 20 Oct 2011 06:42: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: 140 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-dispatcher/trunk] Rev 140: remove the BaseAndroidAction class, moving its only method to LavaAndroidClient Message-Id: <20111020064213.26677.39007.launchpad@ackee.canonical.com> Date: Thu, 20 Oct 2011 06:42: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: 74107b6b78d30941865fda63aba1ab862cda250e Merge authors: Michael Hudson-Doyle (mwhudson) Related merge proposals: https://code.launchpad.net/~mwhudson/lava-dispatcher/eliminate-BaseAndroidAction/+merge/79907 proposed by: Michael Hudson-Doyle (mwhudson) review: Approve - Spring Zhang (qzhang) ------------------------------------------------------------ revno: 140 [merge] committer: Michael Hudson-Doyle branch nick: trunk timestamp: Thu 2011-10-20 19:39:08 +1300 message: remove the BaseAndroidAction class, moving its only method to LavaAndroidClient modified: lava_dispatcher/actions/__init__.py lava_dispatcher/actions/android_0xbench.py lava_dispatcher/actions/android_basic.py lava_dispatcher/actions/boot_control.py lava_dispatcher/android_client.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 === modified file 'lava_dispatcher/actions/__init__.py' --- lava_dispatcher/actions/__init__.py 2011-10-13 01:41:00 +0000 +++ lava_dispatcher/actions/__init__.py 2011-10-20 04:36:56 +0000 @@ -57,20 +57,6 @@ return self.command_name -class BaseAndroidAction(BaseAction): - def __init__(self, context): - self.context = context - - def check_sys_bootup(self): - result_pattern = "([0-1])" - cmd = "getprop sys.boot_completed" - self.client.proc.sendline(cmd) - id = self.client.proc.expect([result_pattern], timeout = 60) - if id == 0: - return True - else: - return False - def _find_commands(module): cmds = {} for name, cls in module.__dict__.iteritems(): === modified file 'lava_dispatcher/actions/android_0xbench.py' --- lava_dispatcher/actions/android_0xbench.py 2011-09-12 22:31:47 +0000 +++ lava_dispatcher/actions/android_0xbench.py 2011-10-20 04:36:56 +0000 @@ -19,17 +19,17 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, see . -from lava_dispatcher.actions import BaseAndroidAction +from lava_dispatcher.actions import BaseAction import time import pexpect import logging -class cmd_test_android_0xbench(BaseAndroidAction): +class cmd_test_android_0xbench(BaseAction): def run(self): #Make sure in test image now self.client.in_test_shell() time.sleep(30) - if not self.check_sys_bootup(): + if not self.client.check_sys_bootup(): # TODO: Fetch the logcat message as attached logging.warning("0xbench Test: sys bootup fail, aborted") return === modified file 'lava_dispatcher/actions/android_basic.py' --- lava_dispatcher/actions/android_basic.py 2011-10-18 02:38:34 +0000 +++ lava_dispatcher/actions/android_basic.py 2011-10-20 04:36:56 +0000 @@ -19,21 +19,19 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, see . -from lava_dispatcher.actions import BaseAndroidAction -from lava_dispatcher.client import OperationFailed +from lava_dispatcher.actions import BaseAction import time import pexpect -import sys import logging from datetime import datetime from lava_dispatcher.android_util import savebundlefile -class cmd_test_android_monkey(BaseAndroidAction): +class cmd_test_android_monkey(BaseAction): def run(self): #Make sure in test image now self.client.in_test_shell() time.sleep(30) - if not self.check_sys_bootup(): + if not self.client.check_sys_bootup(): # TODO: Fetch the logcat message as attachment logging.warning("monkey run test skipped: sys bootup fail") return @@ -65,7 +63,7 @@ self.client.proc.sendline("") -class cmd_test_android_basic(BaseAndroidAction): +class cmd_test_android_basic(BaseAction): def run(self): #Make sure in test image now self.client.in_test_shell() === modified file 'lava_dispatcher/actions/boot_control.py' --- lava_dispatcher/actions/boot_control.py 2011-10-18 02:38:34 +0000 +++ lava_dispatcher/actions/boot_control.py 2011-10-20 04:36:56 +0000 @@ -22,10 +22,10 @@ import logging -from lava_dispatcher.actions import BaseAction, BaseAndroidAction +from lava_dispatcher.actions import BaseAction from lava_dispatcher.client import CriticalError -class cmd_boot_linaro_android_image(BaseAndroidAction): +class cmd_boot_linaro_android_image(BaseAction): """ Call client code to boot to the master image """ def run(self): === modified file 'lava_dispatcher/android_client.py' --- lava_dispatcher/android_client.py 2011-10-20 04:09:15 +0000 +++ lava_dispatcher/android_client.py 2011-10-20 06:38:10 +0000 @@ -198,3 +198,9 @@ time.sleep(1) raise GeneralError('The home screen does not displayed') + def check_sys_bootup(self): + result_pattern = "([0-1])" + cmd = "getprop sys.boot_completed" + self.proc.sendline(cmd) + match_id = self.proc.expect([result_pattern], timeout = 60) + return match_id == 0