From patchwork Wed Oct 17 14:23:13 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Doan X-Patchwork-Id: 12318 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 1D4A51D5172 for ; Wed, 17 Oct 2012 14:23:17 +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 C3CB8A19476 for ; Wed, 17 Oct 2012 14:23:16 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id e10so11455649iej.11 for ; Wed, 17 Oct 2012 07:23:16 -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=d+EbF+Yqs6lcwZuKcfcZF+1povXyLzFWle8NQKk4zgs=; b=D+opijtGRsYEIR9D+EKORfk8Bw99B+sdEPF95o9Y5MD6RyM+7WXVgkqfEZLjcPrEEs 5m6M2QWUO66wTirR+J42bCObe/2kHcWabXM0q+nJUqU/wn5pRqqnn7ituh0KxNLHKpSn NQn54h56IJXpq49PluEJk/dEmsyQOtFpILqefSKYheo4NDBXD6LKOTl8tORp7qKrUiB1 ddPEUTlMvbqA6y3Iq9kGJBEETtn80u7Wso5upEtXfPZ9ue//5ds34Q88yr6CzbYgwGEe Bl2bE+JGeRuEgoTGwiAWlVoD48ysEWjw23azj9l3R9wdoRkpn/W/OwnAf0Pk68NbqZri MALw== Received: by 10.50.91.195 with SMTP id cg3mr1661824igb.57.1350483796556; Wed, 17 Oct 2012 07:23:16 -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.67.148 with SMTP id n20csp904028igt; Wed, 17 Oct 2012 07:23:15 -0700 (PDT) Received: by 10.180.99.133 with SMTP id eq5mr4475164wib.21.1350483794387; Wed, 17 Oct 2012 07:23:14 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id g2si25725287wiy.44.2012.10.17.07.23.13 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 17 Oct 2012 07:23: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; 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 1TOUWf-0005ei-Pu for ; Wed, 17 Oct 2012 14:23:13 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id B72F3E05E4 for ; Wed, 17 Oct 2012 14:23: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: 406 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-dispatcher/trunk] Rev 406: all power_off logic requires a sync Message-Id: <20121017142313.5825.21669.launchpad@ackee.canonical.com> Date: Wed, 17 Oct 2012 14:23:13 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="16152"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: 439c0169c0705d79a50c10cdcb74a1e64e2bcb73 X-Gm-Message-State: ALoCoQkTPBvYuCfYhKBG9PnHrW3S0lS2nYA2WWdSpnZUqi5XsgsKtCYm+Q74TKhYpReh6tn+gmxR ------------------------------------------------------------ revno: 406 committer: Andy Doan branch nick: trunk timestamp: Tue 2012-10-16 22:45:38 -0500 message: all power_off logic requires a sync We missed a case where we weren't doing a sync before calling power_off. This was causing results for FastModels to not get flushed to disk. modified: lava_dispatcher/device/fastmodel.py lava_dispatcher/device/master.py lava_dispatcher/device/qemu.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/device/fastmodel.py' --- lava_dispatcher/device/fastmodel.py 2012-10-17 03:45:38 +0000 +++ lava_dispatcher/device/fastmodel.py 2012-10-17 03:45:38 +0000 @@ -179,7 +179,7 @@ "-C motherboard.hostbridge.userNetPorts='5555=5555' %s") % ( self._sim_binary, self._axf, self._sd_image, options) - def power_off(self, proc): + def _power_off(self, proc): if proc is not None: proc.close() if self._sim_proc is not None: === modified file 'lava_dispatcher/device/master.py' --- lava_dispatcher/device/master.py 2012-10-16 02:31:45 +0000 +++ lava_dispatcher/device/master.py 2012-10-17 03:45:38 +0000 @@ -77,7 +77,7 @@ self._boot_linaro_image() return self.proc - def power_off(self, proc): + def _power_off(self, proc): # we always leave master image devices powered on pass === modified file 'lava_dispatcher/device/qemu.py' --- lava_dispatcher/device/qemu.py 2012-10-16 00:00:24 +0000 +++ lava_dispatcher/device/qemu.py 2012-10-17 03:45:38 +0000 @@ -59,7 +59,7 @@ ensure_directory(path) yield path - def power_off(self, proc): + def _power_off(self, proc): if proc is not None: proc.close() === modified file 'lava_dispatcher/device/target.py' --- lava_dispatcher/device/target.py 2012-10-14 22:11:42 +0000 +++ lava_dispatcher/device/target.py 2012-10-17 03:45:38 +0000 @@ -73,10 +73,10 @@ """ raise NotImplementedError('power_on') - def power_off(self, proc): - """ responsible for powering off the target device + def _power_off(self, proc): + """ responsible for powering off the target device. """ - raise NotImplementedError('power_off') + raise NotImplementedError('_power_off') def deploy_linaro(self, hwpack, rfs): raise NotImplementedError('deploy_image') @@ -87,6 +87,22 @@ def deploy_linaro_prebuilt(self, image): raise NotImplementedError('deploy_linaro_prebuilt') + def power_off(self, proc): + """ tries to safely power off the device by running a sync + operation first + """ + from lava_dispatcher.client.base import CommandRunner + runner = CommandRunner( + proc, + self.deployment_data['TESTER_PS1_PATTERN'], + self.deployment_data['TESTER_PS1_INCLUDES_RC']) + try: + logging.info('attempting a filesystem sync before power_off') + runner.run('sync', timeout=20) + except: + logging.exception('calling sync failed') + self._power_off(proc) + @contextlib.contextmanager def file_system(self, partition, directory): """ Allows the caller to interact directly with a directory on @@ -121,8 +137,6 @@ yield runner finally: if proc and runner: - logging.info('attempting a filesystem sync before power_off') - runner.run('sync', timeout=20) self.power_off(proc) def get_test_data_attachments(self):