From patchwork Mon Oct 14 22:14:53 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ryan S. Arnold" X-Patchwork-Id: 21011 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f198.google.com (mail-ob0-f198.google.com [209.85.214.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B4DD320DA3 for ; Mon, 14 Oct 2013 22:15:04 +0000 (UTC) Received: by mail-ob0-f198.google.com with SMTP id va2sf29217198obc.1 for ; Mon, 14 Oct 2013 15:15:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:x-gm-message-state:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=X6w/MjUmRmLZCzcdB72MEHDJ5XF8URbCHXScVWXRuSI=; b=jreVxn0JHjgSrXbp2cHzRKKcwQE5iZwJ9vlzMVAdNpvzne8i1n/fBwaM4fXnvQ9dwX 2smMznj/IyJy3BIkKG3Q18mwUkgxctJMi5ViAt1Q/QQd/ghnVJnNbRpe/rHwCcRdxUvn I9/NLTRQ82ibztQlec74JLQp4NgJ83ObnFmjhsN9hfejOK7K7/zvNIITePgkfKbw8wYJ XZgYUVrGhvogBkFSDNHmDO7gdqeEt0dlIpLRPn+701VA2jbzj9shG3xElTmfD6PCxf6x BilxS4AUHLJ706awY4/di5TWUayZv5R1Z48cngZ37iZm+ugD5S6ElcyptJkp6TJCSH62 785g== X-Received: by 10.182.109.200 with SMTP id hu8mr13232018obb.20.1381788904060; Mon, 14 Oct 2013 15:15:04 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.84.1 with SMTP id u1ls2347678qey.8.gmail; Mon, 14 Oct 2013 15:15:03 -0700 (PDT) X-Received: by 10.220.69.212 with SMTP id a20mr37204852vcj.10.1381788903870; Mon, 14 Oct 2013 15:15:03 -0700 (PDT) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx.google.com with ESMTPS id m10si2236752veh.44.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 14 Oct 2013 15:15:03 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.182 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.182; Received: by mail-vc0-f182.google.com with SMTP id im17so4940289vcb.27 for ; Mon, 14 Oct 2013 15:15:03 -0700 (PDT) X-Gm-Message-State: ALoCoQmjaDO2b+ur8K8kCaKhc2qCYc209n97tOMMbbk0vsDpwx9dNRGjyQXIBs9hqDxt1W7rpG/u X-Received: by 10.58.207.15 with SMTP id ls15mr3701022vec.17.1381788903682; Mon, 14 Oct 2013 15:15:03 -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.220.174.196 with SMTP id u4csp254313vcz; Mon, 14 Oct 2013 15:15:03 -0700 (PDT) X-Received: by 10.42.54.132 with SMTP id r4mr21459322icg.19.1381788902623; Mon, 14 Oct 2013 15:15:02 -0700 (PDT) Received: from mail-ie0-f172.google.com (mail-ie0-f172.google.com [209.85.223.172]) by mx.google.com with ESMTPS id b10si1415773icq.40.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 14 Oct 2013 15:15:02 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.223.172 is neither permitted nor denied by best guess record for domain of ryan.arnold@linaro.org) client-ip=209.85.223.172; Received: by mail-ie0-f172.google.com with SMTP id x13so16555817ief.3 for ; Mon, 14 Oct 2013 15:15:02 -0700 (PDT) X-Received: by 10.43.77.212 with SMTP id zj20mr21565883icb.5.1381788902021; Mon, 14 Oct 2013 15:15:02 -0700 (PDT) Received: from badwing.hsd1.mn.comcast.net. (c-71-195-40-9.hsd1.mn.comcast.net. [71.195.40.9]) by mx.google.com with ESMTPSA id oq3sm48178igb.1.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 14 Oct 2013 15:15:01 -0700 (PDT) From: "Ryan S. Arnold" To: Rob Savoye Cc: patches@linaro.org, "Ryan S. Arnold" Subject: [PATCH][test_fetch_md5sums_fix] testsuite/test.sh: Always override ${local_snapshots} for tests. Date: Mon, 14 Oct 2013 17:14:53 -0500 Message-Id: <1381788893-22979-1-git-send-email-ryan.arnold@linaro.org> X-Mailer: git-send-email 1.8.3.1 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ryan.arnold@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.182 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 Precedence: list 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: , From: "Ryan S. Arnold" Use a temporary directory /tmp/cbuild.XXX/snapshots for the snapshots directory used in tests. Otherwise it might mangle the local_snapshots directory of an active build. This patch fixes a case where running the testsuite from within an active build directory will move the snapshots directory to snapshots.bak. The fix now uses a new temp directory for every test run. --- testsuite/test.sh | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/testsuite/test.sh b/testsuite/test.sh index b3d3778..3cb2356 100755 --- a/testsuite/test.sh +++ b/testsuite/test.sh @@ -16,20 +16,26 @@ if test -e "${PWD}/host.conf"; then else warning "no host.conf file!" remote_snapshots=http://cbuild.validation.linaro.org/snapshots - local_snapshots=test_snapshots wget_bin=/usr/bin/wget wget_quiet=yes fi +# We always override $local_snapshots so that we don't damage or move the +# local_snapshots directory of an existing build. +local_snapshots="`mktemp -d /tmp/cbuild2.XXX`/snapshots" + +# Let's make sure that the snapshots portion of the directory is created before +# we use it just to be safe. +out="`mkdir -p ${local_snapshots}`" +if test "$?" -gt 1; then + exit 1 +fi + # Since we're testing, we don't load the host.conf file, instead # we create false values that stay consistent. cbuild_top=/build/cbuild2/test hostname=test.foobar.org target=x86_64-linux-gnu -#remote_snapshots=http://cbuild.validation.linaro.org/snapshots -#local_snapshots=test_snapshots -#wget_bin=/usr/bin/wget -#wget_quiet=yes if test x"$1" = x"-v"; then debug=yes @@ -151,11 +157,6 @@ fi # ---------------------------------------------------------------------------------- echo "============= fetch() tests ================" -if test -d "${local_snapshots}"; then - notice "${local_snapshots} directory exists. Moving it to ${local_snapshots}.bak." - mv ${local_snapshots} ${local_snapshots}.bak -fi - out="`fetch md5sums`" if test $? -eq 0; then pass "fetch md5sums"