xfs
[Top] [All Lists]

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

To: xfs@xxxxxxxxxxx
Subject: [PATCH v2 01/12] xfstests: use mount point instead of device name
From: Junho Ryu <jayr@xxxxxxxxxx>
Date: Tue, 17 Dec 2013 14:18:31 -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=BM/QNQsPjjmd53HqwKhuLQ/Abvcy0GucW/LZ4vT2ljA=; b=ILdvTzkJCqQcHlMdMCbW3yXG74+X8Z5ecpnw+0/FQYKqc7V0hnAwEZIpOJCWKGt3GI PgkBtlYS/v2y5N+Ud/o05yYj+IHHMLLaDX3rN/nyJnpGPdpKOJwWd2s7loE9uzEXGBul Gb16suHoDgJLkj7uZ3Ydt5EbG20RAyBirdWyv1QnnYWA3WcthnVuvTYod0iF03XvAS+p kkdrMQK6OXFBTH9ScuRY5DwSuovjIuov5OfIY2cWWNS3aE0zoVG+yV15rcW7I2AoC311 495u8s2Q/SljUvk6ELYUBv27LklQ5Ll9HOvY+qQlTzSsbV3vystwl2Uhz3VLUDT8/TSv bTYw==
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>
---

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>