All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] xfstests: generic/255: Execute only if blocksize is 4k
@ 2013-08-31 17:17 chandan
  0 siblings, 0 replies; only message in thread
From: chandan @ 2013-08-31 17:17 UTC (permalink / raw)
  To: xfs, Eric Sandeen, david; +Cc: Eric Sandeen, sekharan

This patch adds the function _require_4k_blocksize() to perform the
block size check on the filesystem hosted by $TEST_DEV and $SCRATCH_DEV.

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

diff --git a/common/rc b/common/rc
index 77e96c4..fa2bbe0 100644
--- a/common/rc
+++ b/common/rc
@@ -2118,6 +2118,16 @@ _require_dumpe2fs()
 	fi
 }
 
+_require_4k_blocksize()
+{
+	test_dev_bs=`stat -f $TEST_DIR | grep "Block size" | cut -d " " -f3`
+	scratch_dev_bs=`stat -f $SCRATCH_MNT | grep "Block size" | cut -d " " -f3`
+
+	if (( $test_dev_bs != 4096 || $scratch_dev_bs != 4096 )); then
+		_notrun "This test requires a filesystem with 4k block size."
+	fi
+}
+
 _create_loop_device()
 {
 	file=$1
diff --git a/tests/generic/255 b/tests/generic/255
index dd329b4..ce617dc 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_4k_blocksize
 
 testfile=$TEST_DIR/255.$$
 
-- 
1.8.3.1


_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-08-31 17:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-31 17:17 [PATCH v2] xfstests: generic/255: Execute only if blocksize is 4k chandan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.