From patchwork Fri Jul 27 15:40:16 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Doan X-Patchwork-Id: 10336 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 265FC23E3D for ; Fri, 27 Jul 2012 15:40:21 +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 CB978A18699 for ; Fri, 27 Jul 2012 15:40:20 +0000 (UTC) Received: by yhpp61 with SMTP id p61so3318774yhp.11 for ; Fri, 27 Jul 2012 08:40:20 -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=O7Ajqj6G8hFrT6lC9Amo0dZsToPhXSK59qIZFrkyxq0=; b=Un0bU9m2jSbTEbZAPSPQQnzdhY317ETinKL8Tuh+M9BRt4jimycoGUqbeRvI5R7U5/ FPulpsx3CgXWtw5uCbwJMSVASpionI8yeOXjvJEelcWMo1mP7u9hZIkGlOk+DZFuO/No Vtavp6QZC+0SH80mXENI6svwkkvB3B7/Rufo6Qheoo2moocGF36RPypscX4Yx5rFx7Gj 1M+i+BPAt5wXGCEOjfJkkZFFWuV2LkfoAbaYJv8An/Qv/Sh4WOQ6XsvQjl0avtw+hCsc 7tNKhICngy3KFav84yhXF8+/G7PDngfQON/pTT6JvmH2x14cAlTUVMQSvfamqLFyd16c gCkQ== Received: by 10.42.22.206 with SMTP id p14mr1940962icb.23.1343403619991; Fri, 27 Jul 2012 08:40:19 -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.43.93.3 with SMTP id bs3csp38583icc; Fri, 27 Jul 2012 08:40:19 -0700 (PDT) Received: by 10.216.241.198 with SMTP id g48mr1226268wer.192.1343403617265; Fri, 27 Jul 2012 08:40:17 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id hn12si5863747wib.32.2012.07.27.08.40.16 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 27 Jul 2012 08:40:17 -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 1SumeG-0001Yf-HQ for ; Fri, 27 Jul 2012 15:40:16 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id 7350BE01FD for ; Fri, 27 Jul 2012 15:40:16 +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: 359 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-dispatcher/trunk] Rev 359: fastmodel-ubuntu-support Message-Id: <20120727154016.20466.59567.launchpad@ackee.canonical.com> Date: Fri, 27 Jul 2012 15:40:16 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="15694"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: 08fe84e6888b9575f1488f26a50141a0afb08ea0 X-Gm-Message-State: ALoCoQkA1pYTpHc23a20kOwIOpM4sFZWEMzvsW3mYQVnMZ5faWUbOYQFPbDgmZJMSM+ZsHqB8ZXe Merge authors: Andy Doan (doanac) Related merge proposals: https://code.launchpad.net/~doanac/lava-dispatcher/fastmodel-ubuntu-support/+merge/116397 proposed by: Andy Doan (doanac) review: Approve - Spring Zhang (qzhang) ------------------------------------------------------------ revno: 359 [merge] committer: Andy Doan branch nick: lava-dispatcher timestamp: Fri 2012-07-27 10:38:56 -0500 message: fastmodel-ubuntu-support modified: lava_dispatcher/actions/deploy.py lava_dispatcher/actions/launch_control.py lava_dispatcher/actions/lava-test.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/deploy.py' --- lava_dispatcher/actions/deploy.py 2012-07-06 01:43:50 +0000 +++ lava_dispatcher/actions/deploy.py 2012-07-24 03:56:32 +0000 @@ -18,6 +18,7 @@ # along with this program; if not, see . from lava_dispatcher.actions import BaseAction +from lava_dispatcher.client.fastmodel import LavaFastModelClient from lava_dispatcher.client.master import LavaMasterImageClient from lava_dispatcher.client.qemu import LavaQEMUClient @@ -78,7 +79,8 @@ def run(self, hwpack=None, rootfs=None, image=None, kernel_matrix=None, rootfstype='ext3'): if not isinstance(self.client, LavaMasterImageClient) and \ - not isinstance(self.client, LavaQEMUClient): + not isinstance(self.client, LavaQEMUClient) and \ + not isinstance(self.client, LavaFastModelClient): raise RuntimeError("Invalid LavaClient for this action") self.client.deploy_linaro( === modified file 'lava_dispatcher/actions/launch_control.py' --- lava_dispatcher/actions/launch_control.py 2012-06-22 01:25:13 +0000 +++ lava_dispatcher/actions/launch_control.py 2012-07-24 04:01:01 +0000 @@ -113,8 +113,6 @@ status = 'fail' err_msg = err_msg + " Some test case result appending failed." logging.warning(err_msg) - finally: - shutil.rmtree(os.path.dirname(result_path)) except: logging.exception('retrieve_results failed') return device_bundles, status, err_msg === modified file 'lava_dispatcher/actions/lava-test.py' --- lava_dispatcher/actions/lava-test.py 2012-07-19 02:59:59 +0000 +++ lava_dispatcher/actions/lava-test.py 2012-07-24 04:00:12 +0000 @@ -120,6 +120,7 @@ 'type': 'array', 'items': {'type': 'string'}, 'optional': True }, 'timeout': {'type': 'integer', 'optional': True}, + 'install_lava_test': {'type': 'boolean', 'optional': True, 'default': True} }, 'additionalProperties': False, } @@ -133,7 +134,8 @@ else: self.context.test_data.add_result(test_result_name, 'pass') - def run(self, tests, install_python=None, install_deb=None, register=None, timeout=2400): + def run(self, tests, install_python=None, install_deb=None, register=None, + timeout=2400, install_lava_test=True): logging.info( "Executing lava_test_install (%s) command" % ",".join(tests)) @@ -148,7 +150,8 @@ # just ignore it session.run("rm -f /etc/apt/apt.conf.d/30proxy") - _install_lava_test(self.client, session) + if install_lava_test: + _install_lava_test(self.client, session) if install_python: for module in install_python: === modified file 'lava_dispatcher/client/fastmodel.py' --- lava_dispatcher/client/fastmodel.py 2012-07-23 10:42:59 +0000 +++ lava_dispatcher/client/fastmodel.py 2012-07-24 03:59:15 +0000 @@ -34,6 +34,7 @@ from lava_dispatcher.client.lmc_utils import ( image_partition_mounted, generate_android_image, + generate_fastmodel_image, get_partition_offset, ) from lava_dispatcher.downloader import ( @@ -104,6 +105,13 @@ else: self._customize_ubuntu() + def _copy_axf(self, partno, fname): + with image_partition_mounted(self._sd_image, partno) as mntdir: + src = '%s/%s' % (mntdir,fname) + odir = os.path.dirname(self._sd_image) + self._axf = '%s/%s' % (odir, os.path.split(src)[1]) + shutil.copyfile(src, self._axf) + def deploy_linaro_android(self, boot, system, data, pkg=None, rootfstype='ext4'): logging.info("Deploying Android on %s" % self.hostname) @@ -117,15 +125,34 @@ generate_android_image( 'vexpress-a9', self._boot, self._data, self._system, self._sd_image) - # now grab the axf file from the boot partition - with image_partition_mounted(self._sd_image, self.boot_part) as mntdir: - src = '%s/linux-system-ISW.axf' % mntdir - self._axf = \ - '%s/%s' % (os.path.dirname(self._system), os.path.split(src)[1]) - shutil.copyfile(src, self._axf) + self._copy_axf(self.boot_part, 'linux-system-ISW.axf') self._customize_android() + def deploy_linaro(self, hwpack=None, rootfs=None, image=None, + kernel_matrix=None, rootfstype='ext3'): + if image is None: + if hwpack is None or rootfs is None: + raise CriticalError( + "must specify both hwpack and rootfs when not specifying image") + elif hwpack is not None or rootfs is not None: + raise CriticalError( + "cannot specify hwpack or rootfs when specifying image") + + if image is None: + hwpack = download_image(hwpack, self.context, decompress=False) + rootfs = download_image(rootfs, self.context, decompress=False) + odir = os.path.dirname(rootfs) + + generate_fastmodel_image(hwpack, rootfs, odir) + self._sd_image = '%s/sd.img' % odir + self._axf = '%s/img.axf' % odir + else: + self._sd_image = download_image(image, self.context) + self._copy_axf(self.root_part, 'boot/img.axf') + + self._customize_ubuntu() + def _close_sim_proc(self): self._sim_proc.close(True) @@ -143,6 +170,11 @@ os.chmod(self._sd_image, stat.S_IRWXG|stat.S_IRWXU) os.chmod(self._axf, stat.S_IRWXG|stat.S_IRWXU) + #lmc ignores the parent directories group owner + st = os.stat(d) + os.chown(self._axf, st.st_uid, st.st_gid) + os.chown(self._sd_image, st.st_uid, st.st_gid) + def _get_sim_cmd(self): return ("%s -a coretile.cluster0.*=%s " "-C motherboard.smsc_91c111.enabled=1 " @@ -153,12 +185,15 @@ "-C motherboard.hostbridge.userNetPorts='5555=5555'") % ( self._sim_binary, self._axf, self._sd_image) - def _boot_linaro_image(self): + def _stop(self): if self.proc is not None: self.proc.close() if self._sim_proc is not None: self._sim_proc.close() + def _boot_linaro_image(self): + self._stop() + self._fix_perms() sim_cmd = self._get_sim_cmd() @@ -195,6 +230,17 @@ def reliable_session(self): return self.tester_session() + def retrieve_results(self, result_disk): + self._stop() + + tardir = os.path.dirname(self._sd_image) + tarfile = os.path.join(tardir, 'lava_results.tgz') + with image_partition_mounted(self._sd_image, self.root_part) as mnt: + logging_system( + 'tar czf %s -C %s%s .' % ( + tarfile, mnt, self.context.lava_result_dir)) + return 'pass', '', tarfile + class _pexpect_drain(threading.Thread): ''' The simulator process can dump a lot of information to its console. If don't actively read from it, the pipe will get full and the process will