From patchwork Wed Apr 17 14:12:13 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Terceiro X-Patchwork-Id: 16171 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f199.google.com (mail-vc0-f199.google.com [209.85.220.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B78D223911 for ; Wed, 17 Apr 2013 14:12:56 +0000 (UTC) Received: by mail-vc0-f199.google.com with SMTP id ha12sf2683911vcb.2 for ; Wed, 17 Apr 2013 07:12:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-beenthere:x-received:received-spf:x-received :x-forwarded-to:x-forwarded-for:delivered-to:x-received:received-spf :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:x-original-sender :x-original-authentication-results:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe :content-type; bh=jrQBGmtUz5adoUaQPJcowzTnPxgd+hosgnkrI5waIN4=; b=Ntj4/tvEKiyoOABoNQL9Vb4fMtkMVoz1bLUt59KG+BJd8bYkNnY2n1HVXyZ4OLOoTI qyt9+ifUmoY9T9/iL8LJEMNlIR/35UZbxc9V7T5Mh1xTC5sqiDCkM4JxiW9KX/uXgX4i a+IPp9dZ8pw139BuFFA2m2NaI17DeNIG1Ofcy87jP7pextt7KxejVCRSCK8pgLDa0tGL 652R29U5Sy+x6hB8HOzhm8/4PhEgCPiAHCF90bRoOCBQ6tp8wiiIOzlDSvYFUonNoNxV LWuUzDxK3Yprl5DuBwB+9f451FRd/QUgZFiZSUAw5SlqZKVCFH+nWDQl39yMz6eZEChy sitw== X-Received: by 10.236.115.170 with SMTP id e30mr3405346yhh.7.1366207941282; Wed, 17 Apr 2013 07:12:21 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.41.33 with SMTP id c1ls922256qel.0.gmail; Wed, 17 Apr 2013 07:12:21 -0700 (PDT) X-Received: by 10.52.108.10 with SMTP id hg10mr4195499vdb.34.1366207941122; Wed, 17 Apr 2013 07:12:21 -0700 (PDT) Received: from mail-vb0-x22d.google.com (mail-vb0-x22d.google.com [2607:f8b0:400c:c02::22d]) by mx.google.com with ESMTPS id sx2si3986635vdc.110.2013.04.17.07.12.21 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 17 Apr 2013 07:12:21 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c02::22d is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c02::22d; Received: by mail-vb0-f45.google.com with SMTP id w15so1294915vbf.18 for ; Wed, 17 Apr 2013 07:12:21 -0700 (PDT) X-Received: by 10.58.144.170 with SMTP id sn10mr528348veb.7.1366207940959; Wed, 17 Apr 2013 07:12:20 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.127.98 with SMTP id nf2csp75624veb; Wed, 17 Apr 2013 07:12:15 -0700 (PDT) X-Received: by 10.180.12.235 with SMTP id b11mr11290388wic.13.1366207934682; Wed, 17 Apr 2013 07:12:14 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id i4si2184219wjy.118.2013.04.17.07.12.14 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 17 Apr 2013 07:12: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; Received: from ackee.canonical.com ([91.189.89.26]) by indium.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1UST5q-00025u-3D for ; Wed, 17 Apr 2013 14:12:14 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id E155BE0274 for ; Wed, 17 Apr 2013 14: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: 581 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-dispatcher/trunk] Rev 581: [Fu Wei] Add Fedora support Message-Id: <20130417141213.25459.85193.launchpad@ackee.canonical.com> Date: Wed, 17 Apr 2013 14:12:13 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: list X-Generated-By: Launchpad (canonical.com); Revision="16567"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: 14f115ed36b99fb5204e5c92fd944f42bed2004e X-Gm-Message-State: ALoCoQmALmLoMrt7MVhvNSgScItNZFpMqF6YE+XCiMRpsdXxSOeFRc6jSARqwaNIJlVhYj+0+U4/ X-Original-Sender: noreply@launchpad.net X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c02::22d is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Merge authors: Fu Wei (fu-wei) Related merge proposals: https://code.launchpad.net/~fu-wei/lava-dispatcher/modularize-distro-add-fedora-support/+merge/159399 proposed by: Fu Wei (fu-wei) ------------------------------------------------------------ revno: 581 [merge] committer: Antonio Terceiro branch nick: trunk timestamp: Wed 2013-04-17 11:10:40 -0300 message: [Fu Wei] Add Fedora support added: lava_test_shell/distro/fedora/ lava_test_shell/distro/fedora/lava-install-packages lava_test_shell/distro/fedora/lava-installed-packages lava_test_shell/distro/fedora/lava-os-build modified: lava_dispatcher/actions/deploy.py lava_dispatcher/actions/lava_test_shell.py lava_dispatcher/device/master.py lava_dispatcher/device/target.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/deploy.py' --- lava_dispatcher/actions/deploy.py 2012-11-20 13:34:19 +0000 +++ lava_dispatcher/actions/deploy.py 2013-04-17 08:23:50 +0000 @@ -97,7 +97,7 @@ parameters_schema = { 'type': 'object', 'properties': { - 'type': {'type': 'string', 'enum':['ubuntu', 'oe', 'android']}, + 'type': {'type': 'string', 'enum':['ubuntu', 'oe', 'android', 'fedora']}, }, 'additionalProperties': False, } === modified file 'lava_dispatcher/actions/lava_test_shell.py' --- lava_dispatcher/actions/lava_test_shell.py 2013-04-15 19:21:33 +0000 +++ lava_dispatcher/actions/lava_test_shell.py 2013-04-16 02:59:05 +0000 @@ -148,6 +148,11 @@ Target.oe_deployment_data['lava_test_dir'] = '/lava' Target.oe_deployment_data['lava_test_results_part_attr'] = 'root_part' +Target.fedora_deployment_data['distro'] = 'fedora' +Target.fedora_deployment_data['lava_test_sh_cmd'] = '/bin/bash' +Target.fedora_deployment_data['lava_test_dir'] = '/lava' +Target.fedora_deployment_data['lava_test_results_part_attr'] = 'root_part' + # 755 file permissions XMOD = stat.S_IRWXU | stat.S_IXGRP | stat.S_IRGRP | stat.S_IXOTH | stat.S_IROTH === modified file 'lava_dispatcher/device/master.py' --- lava_dispatcher/device/master.py 2013-04-07 13:37:43 +0000 +++ lava_dispatcher/device/master.py 2013-04-16 02:59:05 +0000 @@ -67,14 +67,17 @@ Target.android_deployment_data['boot_cmds'] = 'boot_cmds_android' Target.ubuntu_deployment_data['boot_cmds'] = 'boot_cmds' Target.oe_deployment_data['boot_cmds'] = 'boot_cmds_oe' + Target.fedora_deployment_data['boot_cmds'] = 'boot_cmds' # used for tarballcache logic to get proper boot_cmds Target.ubuntu_deployment_data['data_type'] = 'ubuntu' Target.oe_deployment_data['data_type'] = 'oe' + Target.fedora_deployment_data['data_type'] = 'fedora' self.target_map = { 'android': Target.android_deployment_data, 'oe': Target.oe_deployment_data, 'ubuntu': Target.ubuntu_deployment_data, + 'fedora': Target.fedora_deployment_data, } self.master_ip = None === modified file 'lava_dispatcher/device/target.py' --- lava_dispatcher/device/target.py 2013-03-26 15:05:41 +0000 +++ lava_dispatcher/device/target.py 2013-04-17 13:39:40 +0000 @@ -58,6 +58,11 @@ 'TESTER_PS1_PATTERN': "linaro-test \[rc=(\d+)\]# ", 'TESTER_PS1_INCLUDES_RC': True, } + fedora_deployment_data = { + 'TESTER_PS1': "linaro-test [rc=$(echo \$?)]# ", + 'TESTER_PS1_PATTERN': "linaro-test \[rc=(\d+)\]# ", + 'TESTER_PS1_INCLUDES_RC': True, + } def __init__(self, context, device_config): self.context = context @@ -163,11 +168,29 @@ with open('%s/etc/hostname' % rootdir, 'w') as f: f.write('%s\n' % self.config.hostname) + def _customize_fedora(self, rootdir): + self.deployment_data = Target.fedora_deployment_data + with open('%s/etc/profile' % rootdir, 'a') as f: + f.write('export PS1="%s"\n' % self.deployment_data['TESTER_PS1']) + with open('%s/etc/hostname' % rootdir, 'w') as f: + f.write('%s\n' % self.config.hostname) + def _customize_linux(self, image): root_part = self.config.root_part + os_release_id = 'linux' with image_partition_mounted(image, root_part) as mnt: - if os.path.exists('%s/etc/debian_version' % mnt): + os_release_file = '%s/etc/os-release' % mnt + if os.path.exists(os_release_file): + for line in open(os_release_file): + if line.startswith('ID='): + os_release_id = line[(len('ID=')):] + os_release_id = os_release_id.strip('\"\n') + break + if os_release_id == 'debian' or os_release_id == 'ubuntu' or \ + os.path.exists('%s/etc/debian_version' % mnt): self._customize_ubuntu(mnt) + elif os_release_id == 'fedora': + self._customize_fedora(mnt) else: # assume an OE based image. This is actually pretty safe # because we are doing pretty standard linux stuff, just === added directory 'lava_test_shell/distro/fedora' === added file 'lava_test_shell/distro/fedora/lava-install-packages' --- lava_test_shell/distro/fedora/lava-install-packages 1970-01-01 00:00:00 +0000 +++ lava_test_shell/distro/fedora/lava-install-packages 2013-04-16 02:59:05 +0000 @@ -0,0 +1,3 @@ +#!/bin/sh + +sudo yum -e 0 -y -q install "$@" === added file 'lava_test_shell/distro/fedora/lava-installed-packages' --- lava_test_shell/distro/fedora/lava-installed-packages 1970-01-01 00:00:00 +0000 +++ lava_test_shell/distro/fedora/lava-installed-packages 2013-04-16 02:59:05 +0000 @@ -0,0 +1,3 @@ +#!/bin/sh + +rpm -qa --qf "package: %{NAME} : %{VERSION}-%{RELEASE} \n" === added file 'lava_test_shell/distro/fedora/lava-os-build' --- lava_test_shell/distro/fedora/lava-os-build 1970-01-01 00:00:00 +0000 +++ lava_test_shell/distro/fedora/lava-os-build 2013-04-16 02:59:05 +0000 @@ -0,0 +1,3 @@ +#!/bin/sh + +cat /etc/os-release | grep PRETTY_NAME | cut -d\" -f2