From patchwork Tue Mar 26 17:43:14 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Terceiro X-Patchwork-Id: 15675 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 070F923E10 for ; Tue, 26 Mar 2013 17:43:18 +0000 (UTC) Received: from mail-ve0-f178.google.com (mail-ve0-f178.google.com [209.85.128.178]) by fiordland.canonical.com (Postfix) with ESMTP id 5B7B6A190B7 for ; Tue, 26 Mar 2013 17:43:17 +0000 (UTC) Received: by mail-ve0-f178.google.com with SMTP id db10so2148858veb.9 for ; Tue, 26 Mar 2013 10:43:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :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=Uc31t+RnG+BGMwhAiYCPk124kJwauUpkLABVmvjTX8A=; b=dJbJfhlJ+AYz7JbFuI4FkDCk+67Dx4IiActJO6yjNg6KEDHyyGqUgp2onHh8gjQ+mK 0jwFxKDgNc+d3cZs3U/3leBZH+yfmzBB8unYW5NTwFbfQGCr8xu/x9WquOkhdBrkg0WN YupbASb7hC7ztGKEHpb50lA3IKwQ8c+tR1rLj3fXZcVZCOx+asSRkIesEkhIWIEiruSB KQdeHo9CPuT08XVtah6W8oMvGSUC0XjkFK6emVJ3HsCubYMXVhokJ6WVDIs/svJCNP91 xdQCo6Ue7Fnb1DfNGLZr8fZE0OBaEgnzG8jdLxG8PeZyGAXgu6244sOTSLRx/hZhS76t GTzg== X-Received: by 10.52.31.103 with SMTP id z7mr17154128vdh.56.1364319796867; Tue, 26 Mar 2013 10:43: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.59.4.204 with SMTP id cg12csp81688ved; Tue, 26 Mar 2013 10:43:16 -0700 (PDT) X-Received: by 10.180.183.197 with SMTP id eo5mr4834446wic.28.1364319795629; Tue, 26 Mar 2013 10:43:15 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id ky7si6955693wjb.212.2013.03.26.10.43.15 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 26 Mar 2013 10:43:15 -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 1UKXtz-0005Gp-0T for ; Tue, 26 Mar 2013 17:43:15 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id E7BD6E0594 for ; Tue, 26 Mar 2013 17:43:14 +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: 566 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-dispatcher/trunk] Rev 566: Do not call distro-specific code unconditionally Message-Id: <20130326174314.24053.51353.launchpad@ackee.canonical.com> Date: Tue, 26 Mar 2013 17:43:14 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="16540"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: 652929ea3ad894ce165e8c477900701bb55aae5c X-Gm-Message-State: ALoCoQkl8sCTjulGESbLaVv0lw2tXvUoBsEthGoz1v9tsXrqMGD6nt+wEZu+u618Ppsaf10NmAxx Merge authors: Antonio Terceiro (terceiro) Related merge proposals: https://code.launchpad.net/~terceiro/lava-dispatcher/lava-test-shell-oe/+merge/155283 proposed by: Antonio Terceiro (terceiro) review: Approve - Senthil Kumaran S (stylesen) ------------------------------------------------------------ revno: 566 [merge] fixes bug: https://launchpad.net/bugs/1154583 committer: Antonio Terceiro branch nick: trunk timestamp: Tue 2013-03-26 14:40:23 -0300 message: Do not call distro-specific code unconditionally modified: lava_test_shell/lava-test-runner-ubuntu --- 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_test_shell/lava-test-runner-ubuntu' --- lava_test_shell/lava-test-runner-ubuntu 2013-01-28 08:51:59 +0000 +++ lava_test_shell/lava-test-runner-ubuntu 2013-03-15 16:50:30 +0000 @@ -5,6 +5,12 @@ RESULTSDIR="/lava/results" BINDIR="/lava/bin" +detect_distro() { + test -x /usr/bin/dpkg-query && echo "debian_based" && return + + echo "unknown" +} + hwcontext() { mkdir -p ${RESULTSDIR}/hwcontext @@ -15,7 +21,17 @@ [ -f ${meminfo} ] || cat /proc/meminfo > ${meminfo} } -swcontext() +unknown_swcontext() { + mkdir -p ${RESULTSDIR}/swcontext + build=${RESULTSDIR}/swcontext/build.txt + pkgs=${RESULTSDIR}/swcontext/pkgs.txt + + # we don't know about the software context + echo 'Unsupported distro: cannot determine build version' > "$build" + echo 'Unsupported distro: cannot obtain list of installed packages' > "$pkgs" +} + +debian_based_swcontext() { mkdir -p ${RESULTSDIR}/swcontext build=${RESULTSDIR}/swcontext/build.txt @@ -27,6 +43,10 @@ [ -f ${pkgs} ] || dpkg-query -W -f '${status} ${package} : ${version}\n' | sed -n 's/^install ok installed/package:/p' > ${pkgs} } +swcontext() { + distro=$(detect_distro) + ${distro}_swcontext +} cleanup() {