xfs
[Top] [All Lists]

[PATCH] xfstests: generic/255: Execute only if blocksize <= 4096

To: linux-btrfs@xxxxxxxxxxxxxxx, xfs@xxxxxxxxxxx
Subject: [PATCH] xfstests: generic/255: Execute only if blocksize <= 4096
From: chandan <chandan@xxxxxxxxxxxxxxxxxx>
Date: Sun, 25 Aug 2013 20:36 +0530
Cc: david@xxxxxxxxxxxxx, sekharan@xxxxxxxxxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
User-agent: KMail/4.10.5 (Linux/3.10.7-200.fc19.x86_64; KDE/4.10.5; x86_64; ; )
The patch adds the function _require_le_4k_blocksize to perform the
block size check on $TEST_DEV and $SCRATCH_DEV.

Signed-off-by: chandan <chandan@xxxxxxxxxxxxxxxxxx>
---
 common/rc         | 10 ++++++++++
 tests/generic/255 |  1 +
 2 files changed, 11 insertions(+)

diff --git a/common/rc b/common/rc
index ae80b12..d8ee132 100644
--- a/common/rc
+++ b/common/rc
@@ -2106,6 +2106,16 @@ _require_dumpe2fs()
        fi
 }
 
+_require_le_4k_blocksize()
+{
+       test_dev_bs=`stat -f $TEST_DEV | grep "Block size" | cut -d " " -f3`
+       scratch_dev_bs=`stat -f $SCRATCH_DEV | grep "Block size" | cut -d " " 
-f3`
+
+       if (( $test_dev_bs > 4096 || $scratch_dev_bs > 4096 )); then
+               _notrun "This test requires a filesystem with a block size less 
than or equal to 4k."
+       fi
+}
+
 _create_loop_device()
 {
        file=$1
diff --git a/tests/generic/255 b/tests/generic/255
index dd329b4..763e861 100755
--- a/tests/generic/255
+++ b/tests/generic/255
@@ -49,6 +49,7 @@ _supported_os Linux
 _require_xfs_io_falloc_punch
 _require_xfs_io_falloc
 _require_xfs_io_fiemap
+_require_le_4k_blocksize
 
 testfile=$TEST_DIR/255.$$
 
-- 
1.8.3.1


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