From patchwork Tue Dec 13 05:05:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Goldstein X-Patchwork-Id: 9471767 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5091F60476 for ; Tue, 13 Dec 2016 05:05:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 34C69284B4 for ; Tue, 13 Dec 2016 05:05:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2672A284F7; Tue, 13 Dec 2016 05:05:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9D74E284B4 for ; Tue, 13 Dec 2016 05:05:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750771AbcLMFFZ (ORCPT ); Tue, 13 Dec 2016 00:05:25 -0500 Received: from mail-wj0-f193.google.com ([209.85.210.193]:35900 "EHLO mail-wj0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750703AbcLMFFZ (ORCPT ); Tue, 13 Dec 2016 00:05:25 -0500 Received: by mail-wj0-f193.google.com with SMTP id j10so14615895wjb.3; Mon, 12 Dec 2016 21:05:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=I0UerhIkWAYVroKmvLIksJ5pVhv6g9TYY+mT9sBkvT8=; b=wToPvxNofDNgujQzltgr3+vWjHEBgIfk2R5u686Ql9lQC5vsI9VoOnZGrUjHLhsBex rBr1vCsVmlJ69KPq2GiK0Umj7GF/+LVd6Gu7jUKPxY0DRvMX3bIq+BqMP9y+bFg0CLOu THH5iDhiyNWfNYA68BN1eJYU323prKSPhtJxzdTR3GyyL9poFK0fIUUfBiIpKolS8fu2 4Sv/hQ2t4kBafuA3ZhElIu6PmSd+7W2aOLcdAfkXGz7Nhn0amDhX3a0SE2KqlvpoBC/8 jQ8GU3Q8kgFJCtIZ8JFEjhIg+6uWJ8C4N5/ZRI5MuawFhAbGpw1oeagRWbRu8fnBJcPT 2rUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=I0UerhIkWAYVroKmvLIksJ5pVhv6g9TYY+mT9sBkvT8=; b=VOaZ7tYgQx6UJfCU3bAmGJ9M0BCQ0Wcp3JgJOz5OJBwsXhyEZw+r6gTjhLkFP/XxR8 xOxphIRg1Ivkk3vOHHSuSor0u1v/vZUgY09tFN8XJmleoj9Sxj/LJJHfFbfWbCp+LAyz sG8iJ4e/WHAxgJBeys7YMiP3LOVqrQSXOM+ZXdstp2btMUPOf8oExacWyNNyP1ZZnxs2 6fZ3NAJin9bq6WHU7IEsR7F3v3dTASEwGkpgOujP4jU0SNt5u3TS4lV5xjsyTKgWXW5e NfN67ATMwfQFjOUoASY5rf/ydxMJaaxWN7/iGPLzH66bRNcLI60rocoyIKnnUE7B6jdW Dv3A== X-Gm-Message-State: AKaTC02WwXIYa49T2ctfj2zNnb3oXeu8kDnnDMT0D6b/UJnoxGVLgEA0X8n1AA/48L2laA== X-Received: by 10.194.124.100 with SMTP id mh4mr93965173wjb.154.1481605523320; Mon, 12 Dec 2016 21:05:23 -0800 (PST) Received: from amir-VirtualBox.Home (bzq-109-65-102-174.red.bezeqint.net. [109.65.102.174]) by smtp.gmail.com with ESMTPSA id 138sm688730wms.20.2016.12.12.21.05.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 12 Dec 2016 21:05:22 -0800 (PST) From: Amir Goldstein To: Eryu Guan Cc: Miklos Szeredi , linux-unionfs@vger.kernel.org, fstests@vger.kernel.org Subject: [PATCH] overlay/01[6,8]: do not cd into $SCRATCH_MNT Date: Tue, 13 Dec 2016 07:05:02 +0200 Message-Id: <1481605502-8361-1-git-send-email-amir73il@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP - Avoid cd into $SCRATCH_MNT - Cleanup unneeded _cleanup() Signed-off-by: Amir Goldstein --- tests/overlay/016 | 21 +++++++-------------- tests/overlay/016.out | 4 ++-- tests/overlay/018 | 10 ++++------ tests/overlay/018.out | 12 ++++++------ 4 files changed, 19 insertions(+), 28 deletions(-) diff --git a/tests/overlay/016 b/tests/overlay/016 index 041ab3d..c37a0d4 100755 --- a/tests/overlay/016 +++ b/tests/overlay/016 @@ -32,15 +32,9 @@ seq=`basename $0` seqres=$RESULT_DIR/$seq echo "QA output created by $seq" -tmp=/tmp/$$ status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +trap "exit \$status" 0 1 2 3 15 -_cleanup() -{ - cd / - rm -f $tmp.* -} # get standard environment, filters and checks . ./common/rc @@ -64,7 +58,6 @@ echo "This is old news" > $lowerdir/bar _scratch_mount -cd $SCRATCH_MNT # # case #1: @@ -73,12 +66,12 @@ cd $SCRATCH_MNT # write to rwfd # read from rofd # -$XFS_IO_PROG -r foo \ - -C "open foo" \ +$XFS_IO_PROG -r $SCRATCH_MNT/foo \ + -C "open $SCRATCH_MNT/foo" \ -C "pwrite -S 0x61 0 16" \ -C "file 0" \ -C "pread -v 0 16" \ -| _filter_xfs_io +| _filter_xfs_io | _filter_scratch # # case #2: @@ -86,12 +79,12 @@ $XFS_IO_PROG -r foo \ # write to rwfd # read from mapped memory # -$XFS_IO_PROG -r bar \ +$XFS_IO_PROG -r $SCRATCH_MNT/bar \ -C "mmap -r 0 16" \ - -C "open bar" \ + -C "open $SCRATCH_MNT/bar" \ -C "pwrite -S 0x61 0 16" \ -C "mread -v 0 16" \ -| _filter_xfs_io +| _filter_xfs_io | _filter_scratch status=0 exit diff --git a/tests/overlay/016.out b/tests/overlay/016.out index c49f8dc..a28aaa6 100644 --- a/tests/overlay/016.out +++ b/tests/overlay/016.out @@ -1,8 +1,8 @@ QA output created by 016 wrote 16/16 bytes at offset 0 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -[000] foo (foreign,non-sync,non-direct,read-only) - 001 foo (foreign,non-sync,non-direct,read-write) +[000] SCRATCH_MNT/foo (foreign,non-sync,non-direct,read-only) + 001 SCRATCH_MNT/foo (foreign,non-sync,non-direct,read-write) 00000000: 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 aaaaaaaaaaaaaaaa read 16/16 bytes at offset 0 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) diff --git a/tests/overlay/018 b/tests/overlay/018 index 230245b..92fb63d 100755 --- a/tests/overlay/018 +++ b/tests/overlay/018 @@ -40,7 +40,6 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _cleanup() { - cd / rm -f $tmp.* } @@ -73,7 +72,6 @@ mknod $lowerdir/fifo p _scratch_mount -cd $SCRATCH_MNT rm -f $tmp.before $tmp.after @@ -81,17 +79,17 @@ rm -f $tmp.before $tmp.after # Record inode numbers before and after copy up for f in dir file symlink chrdev blkdev fifo; do - ls -id $f >> $tmp.before + ls -id $SCRATCH_MNT/$f >> $tmp.before # chown -h modifies all those file types - chown -h 100 $f - ls -id $f >> $tmp.after + chown -h 100 $SCRATCH_MNT/$f + ls -id $SCRATCH_MNT/$f >> $tmp.after done # Test stable readdir(3)/getdents(2) d_ino # find by inode number - expect to find file by inode number cat $tmp.before | while read ino f; do - find $f -inum $ino -maxdepth 0 + find $f -inum $ino -maxdepth 0 | _filter_scratch done # Compare before..after - expect silence diff --git a/tests/overlay/018.out b/tests/overlay/018.out index bf4bce8..0e5132c 100644 --- a/tests/overlay/018.out +++ b/tests/overlay/018.out @@ -1,7 +1,7 @@ QA output created by 018 -dir -file -symlink -chrdev -blkdev -fifo +SCRATCH_MNT/dir +SCRATCH_MNT/file +SCRATCH_MNT/symlink +SCRATCH_MNT/chrdev +SCRATCH_MNT/blkdev +SCRATCH_MNT/fifo