From patchwork Wed Oct 9 10:56:25 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anders Roxell X-Patchwork-Id: 20909 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vb0-f71.google.com (mail-vb0-f71.google.com [209.85.212.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1A3BA25C6D for ; Wed, 9 Oct 2013 10:56:54 +0000 (UTC) Received: by mail-vb0-f71.google.com with SMTP id g17sf1174631vbg.10 for ; Wed, 09 Oct 2013 03:56:53 -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:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=vvN5zy/gE0jSk0KUpVI2vsUi2jwWMW/Xqg/Jx58eYQQ=; b=SQi9Mu49jA+FwWVzKOeoNtVaWOWelrwXyLgoyj+aqA9ipc1cQvtq7+yiubEQSBx4jF Iy7uub6VJi+bBl7rDSkFVjnUmF83OOObYdLg5Kl+pa8vYNLk+jCXqYnIwz9HBqJhUs8X 3abbJzXJ/6kxbu4YXXKC5mBgCYvOz+B/fogu6ibka6VH3FPAGau07630OfgPe7+H8kUR p+y6B9zIiOPw8oD3QXaECrguUqO4XeWYfzRWuZoXdNeMS9K0urzZQM1Y1krbhpy7zyvQ UXJH2CepXz+klpRFLCrLQ7urano+dPYolJQ9+d3BFRkdIfxJDT8Grxns80weC7DZRdfK X4BQ== X-Received: by 10.236.135.79 with SMTP id t55mr6890799yhi.39.1381316213922; Wed, 09 Oct 2013 03:56:53 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.121.231 with SMTP id ln7ls628649qeb.57.gmail; Wed, 09 Oct 2013 03:56:53 -0700 (PDT) X-Received: by 10.52.169.37 with SMTP id ab5mr920175vdc.31.1381316213821; Wed, 09 Oct 2013 03:56:53 -0700 (PDT) Received: from mail-vc0-f177.google.com (mail-vc0-f177.google.com [209.85.220.177]) by mx.google.com with ESMTPS id sc5si11577320vdc.61.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 09 Oct 2013 03:56:53 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.177 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.177; Received: by mail-vc0-f177.google.com with SMTP id hv10so363713vcb.36 for ; Wed, 09 Oct 2013 03:56:53 -0700 (PDT) X-Gm-Message-State: ALoCoQlW5tTZlTUZBadO2k8BxPGsJqpdl4t0R8UmGfEWTHbulbziG3/GacaryQMlG9B9j27JHs4m X-Received: by 10.220.145.132 with SMTP id d4mr5154241vcv.9.1381316213701; Wed, 09 Oct 2013 03:56:53 -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 u4csp277556vcz; Wed, 9 Oct 2013 03:56:53 -0700 (PDT) X-Received: by 10.152.2.74 with SMTP id 10mr1239616las.36.1381316212348; Wed, 09 Oct 2013 03:56:52 -0700 (PDT) Received: from mail-la0-f51.google.com (mail-la0-f51.google.com [209.85.215.51]) by mx.google.com with ESMTPS id i8si16908847laa.108.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 09 Oct 2013 03:56:52 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.215.51 is neither permitted nor denied by best guess record for domain of anders.roxell@linaro.org) client-ip=209.85.215.51; Received: by mail-la0-f51.google.com with SMTP id es20so515788lab.38 for ; Wed, 09 Oct 2013 03:56:51 -0700 (PDT) X-Received: by 10.152.171.72 with SMTP id as8mr1426985lac.33.1381316211193; Wed, 09 Oct 2013 03:56:51 -0700 (PDT) Received: from localhost (c-853670d5.07-21-73746f28.cust.bredbandsbolaget.se. [213.112.54.133]) by mx.google.com with ESMTPSA id n15sm34583954laa.2.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 09 Oct 2013 03:56:50 -0700 (PDT) From: Anders Roxell To: davej@redhat.com Cc: trinity@vger.kernel.org, patches@linaro.org, Anders Roxell Subject: [PATCH 2/3] scripts: change mkdir tmp to mktemp Date: Wed, 9 Oct 2013 12:56:25 +0200 Message-Id: <1381316186-8562-3-git-send-email-anders.roxell@linaro.org> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1381316186-8562-1-git-send-email-anders.roxell@linaro.org> References: <1381316186-8562-1-git-send-email-anders.roxell@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: anders.roxell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.177 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: , Signed-off-by: Anders Roxell --- scripts/find.sh | 10 ++++------ scripts/test-all-syscalls-parallel.sh | 8 +++----- scripts/test-all-syscalls-sequentially.sh | 9 +++------ scripts/test-multi.sh | 12 +++++------- scripts/test-vm.sh | 8 +++----- 5 files changed, 18 insertions(+), 29 deletions(-) diff --git a/scripts/find.sh b/scripts/find.sh index 5528210..3f10c58 100755 --- a/scripts/find.sh +++ b/scripts/find.sh @@ -6,6 +6,7 @@ # TRINITY_PATH=${TRINITY_PATH:-.} +TRINITY_TMP=$(mktemp -d /tmp/trinity.XXXXXX) check_tainted() { @@ -15,11 +16,8 @@ check_tainted() fi } -if [ ! -d tmp ]; then - mkdir tmp -fi -chmod 755 tmp -cd tmp +chmod 755 $TRINITY_TMP +cd $TRINITY_TMP TAINT=$(cat /proc/sys/kernel/tainted) @@ -46,7 +44,7 @@ do check_tainted - chmod 755 ../tmp + chmod 755 $TRINITY_TMP done diff --git a/scripts/test-all-syscalls-parallel.sh b/scripts/test-all-syscalls-parallel.sh index c713cce..312fd2a 100755 --- a/scripts/test-all-syscalls-parallel.sh +++ b/scripts/test-all-syscalls-parallel.sh @@ -1,12 +1,10 @@ #!/bin/bash TRINITY_PATH=${TRINITY_PATH:-.} +TRINITY_TMP=$(mktemp -d /tmp/trinity.XXXXXX) -if [ ! -d tmp ]; then - mkdir tmp -fi -chmod 755 tmp -cd tmp +chmod 755 $TRINITY_TMP +cd $TRINITY_TMP while [ 1 ]; do diff --git a/scripts/test-all-syscalls-sequentially.sh b/scripts/test-all-syscalls-sequentially.sh index 6d79db4..2b726fc 100755 --- a/scripts/test-all-syscalls-sequentially.sh +++ b/scripts/test-all-syscalls-sequentially.sh @@ -4,6 +4,7 @@ # causing trinity to segfault. TRINITY_PATH=${TRINITY_PATH:-.} +TRINITY_TMP=$(mktemp -d /tmp/trinity.XXXXXX) check_tainted() { @@ -13,18 +14,14 @@ check_tainted() fi } -if [ ! -d tmp ]; then - mkdir tmp -fi - TAINT=$(cat /proc/sys/kernel/tainted) while [ 1 ] do for syscall in $($TRINITY_PATH/trinity -L | grep entrypoint | grep -v AVOID | awk '{ print $4 }' | sort -u) do - chmod 755 tmp - pushd tmp + chmod 755 $TRINITY_TMP + pushd $TRINITY_TMP if [ ! -f $TRINITY_PATH/trinity ]; then echo lost! diff --git a/scripts/test-multi.sh b/scripts/test-multi.sh index 993e124..0b2a629 100755 --- a/scripts/test-multi.sh +++ b/scripts/test-multi.sh @@ -1,6 +1,7 @@ #!/bin/bash TRINITY_PATH=${TRINITY_PATH:-.} +TRINITY_TMP=$(mktemp -d /tmp/trinity.XXXXXX) check_tainted() { @@ -10,11 +11,8 @@ check_tainted() fi } -if [ ! -d tmp ]; then - mkdir tmp -fi -chmod 755 tmp -cd tmp +chmod 755 $TRINITY_TMP +cd $TRINITY_TMP TAINT=$(cat /proc/sys/kernel/tainted) @@ -29,7 +27,7 @@ do for i in `seq 1 $NR_PROCESSES` do - chmod 755 ../tmp + chmod 755 ../$TRINITY_TMP if [ -d tmp.$i ]; then chmod 755 tmp.$i rm -rf tmp.$i @@ -55,7 +53,7 @@ do sleep 1 check_tainted - chmod 755 ../tmp + chmod 755 ../$TRINITY_TMP for i in `seq 1 $NR_PROCESSES` do diff --git a/scripts/test-vm.sh b/scripts/test-vm.sh index 6b75e8d..6804c0e 100755 --- a/scripts/test-vm.sh +++ b/scripts/test-vm.sh @@ -1,12 +1,10 @@ #!/bin/bash TRINITY_PATH=${TRINITY_PATH:-.} +TRINITY_TMP=$(mktemp -d /tmp/trinity.XXXXXX) -if [ ! -d tmp ]; then - mkdir tmp -fi -chmod 755 tmp -cd tmp +chmod 755 $TRINITY_TMP +cd $TRINITY_TMP NR_CPUS=`grep ^processor /proc/cpuinfo | /usr/bin/wc -l` NR_PROCESSES=$(($NR_CPUS * 2))