diff mbox

[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
State Accepted
Headers show

Commit Message

Yongqin Liu Nov. 7, 2012, 1:21 p.m. UTC
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 <yongqin.liu@linaro.org>
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
diff mbox

Patch

=== 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 <paul.larson@linaro.org>
+#
+# 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 <http://www.gnu.org/licenses>.
+
+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