From patchwork Thu Aug 2 23:09:11 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Doan X-Patchwork-Id: 10475 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 8613723E56 for ; Thu, 2 Aug 2012 23:09:16 +0000 (UTC) Received: from mail-yw0-f52.google.com (mail-yw0-f52.google.com [209.85.213.52]) by fiordland.canonical.com (Postfix) with ESMTP id 3F99BA19292 for ; Thu, 2 Aug 2012 23:09:16 +0000 (UTC) Received: by yhpp61 with SMTP id p61so97639yhp.11 for ; Thu, 02 Aug 2012 16:09:15 -0700 (PDT) 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=VTQchoA7OUxmrpcIPUfjZVlAYO66e2Zr99P4Gl5B7gk=; b=kQKlMZ0Zs7J9bp+XWNROWQ8/QKGq/wUr30m6HHiIkUnFAH/I/wwpT3NMdJuu8BQKyc ieKEJqOc6mJvRovyg59GSiHT1UrbC+0/cTU+Z/QutSBeYKROdDzvPCqegxFMvdl8lstw hH2iCFtLX2xhVH3NJUs3jcfnBYE0cZnDV6bPaogqnXXDMOjqKRcG7Omns1sDNZIKOyyl 89aZEBiOGeafKTirIKL54vokCnXO8PhPq03QSIHBtuPNpERGJdxdFIKJ2rT7GXa/gxtS rfLUVLiIOQ4HRMYbsEG9pRY9vfgEyHpWBd0IhDj6OHrD2Zh2UJUiCVMssOVj/WLV5IA9 +/mw== Received: by 10.50.160.168 with SMTP id xl8mr6622347igb.25.1343948955373; Thu, 02 Aug 2012 16:09: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.50.87.40 with SMTP id u8csp283706igz; Thu, 2 Aug 2012 16:09:13 -0700 (PDT) Received: by 10.217.2.197 with SMTP id p47mr10732208wes.55.1343948952482; Thu, 02 Aug 2012 16:09:12 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id gz8si40239669wib.15.2012.08.02.16.09.12 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 02 Aug 2012 16:09:12 -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 1Sx4Vz-0008Vz-Vn for ; Thu, 02 Aug 2012 23:09:11 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id E6821E017C for ; Thu, 2 Aug 2012 23:09: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: 364 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-dispatcher/trunk] Rev 364: allow clients to recieve custom boot options Message-Id: <20120802230911.21293.20091.launchpad@ackee.canonical.com> Date: Thu, 02 Aug 2012 23:09: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="15719"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: fc30462f20379a2dcb0fc33aaa2a16f374806151 X-Gm-Message-State: ALoCoQmJtLwn42nQOYNKWcvJevLANNm4X+YUF+6OMaeOY0npPtePBVB5waVrkRfxlvtSwmlCUbk0 Merge authors: Andy Doan (doanac) Related merge proposals: https://code.launchpad.net/~doanac/lava-dispatcher/boot-option-support/+merge/117130 proposed by: Andy Doan (doanac) review: Approve - Paul Larson (pwlars) ------------------------------------------------------------ revno: 364 [merge] committer: Andy Doan branch nick: lava-dispatcher timestamp: Thu 2012-08-02 18:06:22 -0500 message: allow clients to recieve custom boot options modified: lava_dispatcher/actions/__init__.py lava_dispatcher/actions/boot_control.py lava_dispatcher/client/fastmodel.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 2012-03-19 18:25:52 +0000 +++ lava_dispatcher/actions/__init__.py 2012-08-01 19:56:15 +0000 @@ -71,6 +71,7 @@ @classmethod def validate_parameters(cls, params): if cls.parameters_schema: + if params is None: params = {} schema = Schema(cls.parameters_schema) Validator.validate(schema, params) === modified file 'lava_dispatcher/actions/boot_control.py' --- lava_dispatcher/actions/boot_control.py 2012-03-11 22:12:52 +0000 +++ lava_dispatcher/actions/boot_control.py 2012-07-27 16:49:32 +0000 @@ -25,15 +25,24 @@ from lava_dispatcher.actions import BaseAction, null_or_empty_schema from lava_dispatcher.client.base import CriticalError +_boot_schema = { + 'type': 'object', + 'properties': { + 'options': {'type': 'array', 'items': {'type': 'string'}, + 'optional': True}, + }, + 'additionalProperties': False, + } class cmd_boot_linaro_android_image(BaseAction): """ Call client code to boot to the master image """ - parameters_schema = null_or_empty_schema + parameters_schema = _boot_schema - def run(self): + def run(self, options=[]): client = self.client + client.boot_options = options try: client.boot_linaro_android_image() except Exception as e: @@ -44,10 +53,11 @@ """ Call client code to boot to the test image """ - parameters_schema = null_or_empty_schema + parameters_schema = _boot_schema - def run(self): + def run(self, options=[]): client = self.client + client.boot_options = options status = 'pass' try: client.boot_linaro_image() === modified file 'lava_dispatcher/client/fastmodel.py' --- lava_dispatcher/client/fastmodel.py 2012-08-02 23:05:53 +0000 +++ lava_dispatcher/client/fastmodel.py 2012-08-02 23:06:22 +0000 @@ -58,6 +58,16 @@ SYS_PARTITION = 2 DATA_PARTITION = 5 + BOOT_OPTIONS = { + 'motherboard.smsc_91c111.enabled': '1', + 'motherboard.hostbridge.userNetworking': '1', + 'coretile.cache_state_modelled': '0', + 'coretile.cluster0.cpu0.semihosting-enable': '1', + } + + # a list of allowable values for BOOT_OPTIONS + BOOT_VALS = [ '0', '1' ] + def __init__(self, context, config): super(LavaFastModelClient, self).__init__(context, config) self._sim_binary = config.get('simulator_binary', None) @@ -181,15 +191,27 @@ os.chown(self._axf, st.st_uid, st.st_gid) os.chown(self._sd_image, st.st_uid, st.st_gid) + def _boot_options(self): + options = dict(self.BOOT_OPTIONS) + for option in self.boot_options: + keyval = option.split('=') + if len(keyval) != 2: + logging.warn("Invalid boot option format: %s" % option) + elif keyval[0] not in self.BOOT_OPTIONS: + logging.warn("Invalid boot option: %s" % keyval[0]) + elif keyval[1] not in self.BOOT_VALS: + logging.warn("Invalid boot option value: %s" % option) + else: + options[keyval[0]] = keyval[1] + + return ' '.join(['-C %s=%s' %(k,v) for k,v in options.iteritems()]) + def _get_sim_cmd(self): + options = self._boot_options() return ("%s -a coretile.cluster0.*=%s " - "-C motherboard.smsc_91c111.enabled=1 " - "-C motherboard.hostbridge.userNetworking=1 " "-C motherboard.mmc.p_mmc_file=%s " - "-C coretile.cache_state_modelled=0 " - "-C coretile.cluster0.cpu0.semihosting-enable=1 " - "-C motherboard.hostbridge.userNetPorts='5555=5555'") % ( - self._sim_binary, self._axf, self._sd_image) + "-C motherboard.hostbridge.userNetPorts='5555=5555' %s") % ( + self._sim_binary, self._axf, self._sd_image, options) def _stop(self): if self.proc is not None: