From patchwork Wed Nov 7 13:21:11 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yongqin Liu X-Patchwork-Id: 12714 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 AC60223E05 for ; Wed, 7 Nov 2012 13:21:15 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id 256AEA198B8 for ; Wed, 7 Nov 2012 13:21:15 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id e10so2198504iej.11 for ; Wed, 07 Nov 2012 05:21:14 -0800 (PST) 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=oBWkEgjwWGepo4/89m9VnyIreoyU0k0+oCSUUGcvZrM=; b=PuQDh6NRSodOxYNZ7m/GLgIkvoplxT+vJWsko5Jwgh3FfyhC4C8R9VZdcnwN/3Sz0I MrVYbdxWEdQZ2SzEfXqbzjspaAGQbGcwCCUCiMsS42CWV5eDhgwu8Pk7OOgC8/HL35AW wuKSsoTKMNmPpfQx8OnVc3lKzGG5kAzx1Hii5dTJTYiBkK4sQuMpgPQNebzvIKzDN4Ii HXmSk+/L4srcLvyCE0oJP0Eb8+dY/W8jv+D0nkhvwwOB15X5roOpKhUtFAgsf5nYoxyu RGDyl1sL6gmiyKyWHmKEhTY9FesfurflOOrQ/aSfQZ1PeZi9XeFzBfjrH2Z1KojY0q0P Zw3g== Received: by 10.50.161.169 with SMTP id xt9mr16217700igb.62.1352294474609; Wed, 07 Nov 2012 05:21: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.50.67.148 with SMTP id n20csp213850igt; Wed, 7 Nov 2012 05:21:13 -0800 (PST) Received: by 10.180.106.9 with SMTP id gq9mr7661990wib.12.1352294472651; Wed, 07 Nov 2012 05:21:12 -0800 (PST) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id fp2si2391441wib.6.2012.11.07.05.21.12 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 07 Nov 2012 05:21:12 -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 1TW5Z9-0001Lq-Sy for ; Wed, 07 Nov 2012 13:21:11 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id C7F9FE0151 for ; Wed, 7 Nov 2012 13:21:11 +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: 437 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-dispatcher/trunk] Rev 437: add action for installing medias of CTS test Message-Id: <20121107132111.6342.31159.launchpad@ackee.canonical.com> Date: Wed, 07 Nov 2012 13:21:11 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="16232"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: f443bdfddd734427960002bcbab3a46dede53faf X-Gm-Message-State: ALoCoQnTeBx5yPaMZ3kX15rUDDXquKOMGV/YJo/lJSDufFGHMIfBtVNs5usQ3hoiwkP67Mx3oejU Merge authors: Yongqin Liu (liuyq0307) Related merge proposals: https://code.launchpad.net/~liuyq0307/lava-dispatcher/cts-cpu-consume/+merge/132103 proposed by: Yongqin Liu (liuyq0307) review: Approve - Michael Hudson-Doyle (mwhudson) ------------------------------------------------------------ revno: 437 [merge] committer: Yongqin Liu branch nick: lava-dispatcher timestamp: Wed 2012-11-07 21:19:59 +0800 message: add action for installing medias of CTS test added: lava_dispatcher/actions/android_install_cts_medias.py modified: lava_dispatcher/config.py lava_dispatcher/default-config/lava-dispatcher/device-defaults.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 === added file 'lava_dispatcher/actions/android_install_cts_medias.py' --- lava_dispatcher/actions/android_install_cts_medias.py 1970-01-01 00:00:00 +0000 +++ lava_dispatcher/actions/android_install_cts_medias.py 2012-10-25 06:33:00 +0000 @@ -0,0 +1,50 @@ +# Copyright (C) 2012 Linaro Limited +# +# Author: Paul Larson +# +# 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.actions import BaseAction + + +class cmd_android_install_cts_medias(BaseAction): + + parameters_schema = { + 'type': 'object', + 'properties': { + 'media_url': {'type': 'string', 'optional': True}, + 'timeout': {'type': 'integer', 'optional': True}, + }, + 'additionalProperties': False, + } + + def run(self, media_url=None, timeout=2400): + if not media_url: + media_url = self.client.config.cts_media_url + if not media_url: + logging.error("The url for the cts media files is not specified") + return + + with self.client.target_device._as_master() as session: + if not session.has_partition_with_label('sdcard'): + return + session.run('mkdir -p /mnt/lava/sdcard') + session.run( + 'mount /dev/disk/by-label/sdcard /mnt/lava/sdcard') + self.client.target_device.target_extract( + session, media_url, '/mnt/lava/sdcard', timeout=timeout) + session.run('umount /mnt/lava/sdcard') === modified file 'lava_dispatcher/config.py' --- lava_dispatcher/config.py 2012-10-17 16:51:09 +0000 +++ lava_dispatcher/config.py 2012-10-23 08:54:22 +0000 @@ -28,6 +28,7 @@ class DeviceSchema(schema.Schema): android_binary_drivers = schema.StringOption() + cts_media_url = schema.StringOption() boot_cmds = schema.StringOption(fatal=True) # Can do better here boot_cmds_android = schema.StringOption(fatal=True) # And here boot_cmds_oe = schema.StringOption(fatal=True) # And here? === modified file 'lava_dispatcher/default-config/lava-dispatcher/device-defaults.conf' --- lava_dispatcher/default-config/lava-dispatcher/device-defaults.conf 2012-10-12 03:06:46 +0000 +++ lava_dispatcher/default-config/lava-dispatcher/device-defaults.conf 2012-10-25 08:38:28 +0000 @@ -111,5 +111,9 @@ # 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" + +# the url of the media files for CTS test +cts_media_url = http://testdata.validation.linaro.org/cts/media.tgz + # how long the disablesuspend script should take to complete #disablesuspend_timeout = 240