xfs
[Top] [All Lists]

[PATCH v3 01/12] xfstests: use mount point instead of device name

To: xfs@xxxxxxxxxxx
Subject: [PATCH v3 01/12] xfstests: use mount point instead of device name
From: Junho Ryu <jayr@xxxxxxxxxx>
Date: Wed, 18 Dec 2013 10:15:52 -0800
Cc: branto@xxxxxxxxxx, hughd@xxxxxxxxxx, tytso@xxxxxxx, Junho Ryu <jayr@xxxxxxxxxx>
Delivered-to: xfs@xxxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=fE18PLh5i3nq+HPRuMlD5HE/3bWoBdgwsdPXh4Asiyw=; b=M2dS7pQIhszmNS2/Oadmod1Mlt7fWP+oK0kUNC1zG73HH4LyKhEBo+8CCWyQy2Y9xE bVZdnY5HNc6mJDWZ9gL/Q1rolNf5QiC+ESWU+533T+B8pqFOBvooVHi789P5ILODPe5Z taeUB7tPzF9C+IwOgg/bnVFj/tqods8P8dONNHEcyPEpKFUx37XqhZEsse/mAi7DwTPI V/4gEx/lRnYQLD35XZ06225IhXSF65xDCxm5s6H7J/pMQ9MlH4X0nSsADgeiiUvk+q+0 wF0mhWN7fxpwnS41XlYH9Tj/uNQcnrEiE6vyMK5cI5dhuQf9WMT0T6Nrz8qw/I/sxWIx jX+g==
From: Hugh Dickins <hughd@xxxxxxxxxx>

A tmpfs mount does not involve any block device, its $SCRATCH_DEV is
nothing but a place-holder, so apply 'df' or 'stat' to its mount point
$SCRATCH_MNT instead of to $SCRATCH_DEV.

It also fixes a bug in generic/256: "stat -f $SCRATCH_DEV" returning the
block size of the root file system, but not the test file system.

$ df | grep sda
/dev/sda1    233191    62959    157791    29%    /boot

$ sudo dumpe2fs -h /dev/sda1 | grep "Block size"
Block size:               1024

$ stat -f /dev/sda1 | grep "Block size"
Block size: 4096       Fundamental block size: 4096

$ stat -f /boot | grep "Block size"
Block size: 1024       Fundamental block size: 1024

Signed-off-by: Hugh Dickins <hughd@xxxxxxxxxx>
Signed-off-by: Theodore Ts'o <tytso@xxxxxxx>
Signed-off-by: Junho Ryu <jayr@xxxxxxxxxx>
---

v3: same as v1

v2: same as v1

 tests/generic/256 | 2 +-
 tests/generic/273 | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/generic/256 b/tests/generic/256
index cfe7237..c6c8f2f 100755
--- a/tests/generic/256
+++ b/tests/generic/256
@@ -170,7 +170,7 @@ _scratch_mount
 # Test must be able to write files with non-root permissions
 chmod 777 $SCRATCH_MNT
 
-block_size=`stat -f $SCRATCH_DEV | grep "Block size" | cut -d " " -f3`
+block_size=`stat -f $SCRATCH_MNT | grep "Block size" | cut -d " " -f3`
 _test_full_fs_punch $(( $block_size * 2 )) $block_size 500 $SCRATCH_MNT/252.$$ 
$block_size
 
 status=0 ; exit
diff --git a/tests/generic/273 b/tests/generic/273
index 8e121a2..dc87a92 100755
--- a/tests/generic/273
+++ b/tests/generic/273
@@ -68,7 +68,7 @@ _file_create()
 
        cd $SCRATCH_MNT/origin
 
-       _disksize=`$DF_PROG --block-size=1 $SCRATCH_DEV | tail -1 | awk '{ 
print $5 }'`
+       _disksize=`$DF_PROG --block-size=1 $SCRATCH_MNT | tail -1 | awk '{ 
print $5 }'`
        _disksize=$(($_disksize / 3))
        _num=$(($_disksize / $count / $threads / 4096))
        _count=$count
-- 
1.8.5.1

<Prev in Thread] Current Thread [Next in Thread>