From patchwork Wed Jul 6 18:50:48 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Larson X-Patchwork-Id: 2510 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 9A58A23F5F for ; Wed, 6 Jul 2011 18:50:51 +0000 (UTC) Received: from mail-qw0-f52.google.com (mail-qw0-f52.google.com [209.85.216.52]) by fiordland.canonical.com (Postfix) with ESMTP id 4CDF4A18103 for ; Wed, 6 Jul 2011 18:50:51 +0000 (UTC) Received: by qwb8 with SMTP id 8so144209qwb.11 for ; Wed, 06 Jul 2011 11:50:50 -0700 (PDT) Received: by 10.229.1.140 with SMTP id 12mr6789421qcf.118.1309978250670; Wed, 06 Jul 2011 11:50:50 -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.229.48.135 with SMTP id r7cs87391qcf; Wed, 6 Jul 2011 11:50:50 -0700 (PDT) Received: by 10.216.78.212 with SMTP id g62mr7756000wee.22.1309978249527; Wed, 06 Jul 2011 11:50:49 -0700 (PDT) Received: from adelie.canonical.com (adelie.canonical.com [91.189.90.139]) by mx.google.com with ESMTP id a70si16479935wek.31.2011.07.06.11.50.49; Wed, 06 Jul 2011 11:50:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.139 as permitted sender) client-ip=91.189.90.139; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.139 as permitted sender) smtp.mail=bounces@canonical.com Received: from loganberry.canonical.com ([91.189.90.37]) by adelie.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1QeXBQ-0002Mw-PP for ; Wed, 06 Jul 2011 18:50:48 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id BA5802E8067 for ; Wed, 6 Jul 2011 18:50:48 +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: 75 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-dispatcher/trunk] Rev 75: Add lsb-release to dependencies, and some misc pep8 cleanups Message-Id: <20110706185048.18276.49524.launchpad@loganberry.canonical.com> Date: Wed, 06 Jul 2011 18:50:48 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="13376"; Instance="initZopeless config overlay" X-Launchpad-Hash: 96e01687c1a67095ddacb1cbaec285006d158550 ------------------------------------------------------------ revno: 75 committer: Paul Larson branch nick: dispatcher-testing-branch timestamp: Wed 2011-07-06 13:47:51 -0500 message: Add lsb-release to dependencies, and some misc pep8 cleanups modified: lava_dispatcher/actions/lava-test.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/lava-test.py' --- lava_dispatcher/actions/lava-test.py 2011-07-01 05:38:44 +0000 +++ lava_dispatcher/actions/lava-test.py 2011-07-06 18:47:51 +0000 @@ -25,19 +25,21 @@ from lava_dispatcher.client import OperationFailed from lava_dispatcher.config import LAVA_RESULT_DIR, MASTER_STR, TESTER_STR + class cmd_lava_test_run(BaseAction): def run(self, test_name, timeout=-1): #Make sure in test image now client = self.client client.in_test_shell() client.run_shell_command('mkdir -p %s' % LAVA_RESULT_DIR, - response = TESTER_STR) + response=TESTER_STR) client.export_display() bundle_name = test_name + "-" + datetime.now().strftime("%H%M%S") client.run_shell_command( 'lava-test run %s -o %s/%s.bundle' % ( test_name, LAVA_RESULT_DIR, bundle_name), - response = TESTER_STR, timeout = timeout) + response=TESTER_STR, timeout=timeout) + class cmd_lava_test_install(BaseAction): """ @@ -55,57 +57,61 @@ #install bazaar in tester image client.run_shell_command( 'mkdir -p /mnt/root', - response = MASTER_STR) + response=MASTER_STR) client.run_shell_command( 'mount /dev/disk/by-label/testrootfs /mnt/root', - response = MASTER_STR) + response=MASTER_STR) client.run_shell_command( 'cp -f /mnt/root/etc/resolv.conf /mnt/root/etc/resolv.conf.bak', - response = MASTER_STR) + response=MASTER_STR) client.run_shell_command( 'cp -L /etc/resolv.conf /mnt/root/etc', - response = MASTER_STR) + response=MASTER_STR) #eliminate warning: Can not write log, openpty() failed # (/dev/pts not mounted?), does not work client.run_shell_command( 'mount --rbind /dev /mnt/root/dev', - response = MASTER_STR) + response=MASTER_STR) client.run_shell_command( 'chroot /mnt/root apt-get update', - response = MASTER_STR) + response=MASTER_STR) #Install necessary packages for build lava-test + cmd = ('chroot /mnt/root apt-get -y install bzr usbutils python-apt ' + 'python-setuptools python-simplejson lsb-release') client.run_shell_command( - 'chroot /mnt/root apt-get -y install bzr usbutils python-apt python-setuptools python-simplejson', - response = MASTER_STR, timeout=2400) + cmd, + response=MASTER_STR, timeout=2400) client.run_shell_command( 'chroot /mnt/root bzr branch lp:lava-test', - response = MASTER_STR) + response=MASTER_STR) client.run_shell_command( 'chroot /mnt/root sh -c "cd lava-test && python setup.py install"', - response = MASTER_STR) + response=MASTER_STR) #Test if lava-test installed try: client.run_shell_command( 'chroot /mnt/root lava-test help', - response = "list-tests") + response="list-tests") except: raise OperationFailed("lava-test deployment failed") for test in tests: client.run_shell_command( 'chroot /mnt/root lava-test install %s' % test, - response = MASTER_STR) + response=MASTER_STR) #clean up client.run_shell_command( 'cp -f /mnt/root/etc/resolv.conf.bak /mnt/root/etc/resolv.conf', - response = MASTER_STR) + response=MASTER_STR) client.run_shell_command( 'rm -rf /mnt/root/lava-test', - response = MASTER_STR) + response=MASTER_STR) + cmd = ('cat /proc/mounts | awk \'{print $2}\' | grep "^/mnt/root/dev"' + '| sort -r | xargs umount') client.run_shell_command( - 'cat /proc/mounts | awk \'{print $2}\' | grep "^/mnt/root/dev" | sort -r | xargs umount', - response = MASTER_STR) + cmd, + response=MASTER_STR) client.run_shell_command( 'umount /mnt/root', - response = MASTER_STR) + response=MASTER_STR)