]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
common: add _require_scratch_shtudown
authorJaegeuk Kim <jaegeuk@kernel.org>
Thu, 12 Feb 2015 03:14:52 +0000 (14:14 +1100)
committerDave Chinner <david@fromorbit.com>
Thu, 12 Feb 2015 03:14:52 +0000 (14:14 +1100)
This is to detect whether filesystem supports shutdown feature or not.
And let use this into the following xfs tests.

 xfs/053         (data exposure)
 xfs/137         (data vs filesize)
 xfs/138         (data vs filesize vs truncate)
 xfs/139         (data vs filesize vs partial truncate)
 xfs/140         (data vs filesize vs extending truncate)
 xfs/179         (data vs filesize w/ fsync)
 xfs/180         (data vs filesize w/ sync)
 xfs/182         (data vs filesize w/ recovery)
 xfs/200         (recovery vs ro-block device)
 xfs/306         (fsstress vs recovery)

 xfs/085
 xfs/086
 xfs/087

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
14 files changed:
common/rc
tests/xfs/053
tests/xfs/085
tests/xfs/086
tests/xfs/087
tests/xfs/137
tests/xfs/138
tests/xfs/139
tests/xfs/140
tests/xfs/179
tests/xfs/180
tests/xfs/182
tests/xfs/200
tests/xfs/306

index f6a603de5cbf7eb2d20392bcc8e2eb532807cad5..b916ea01e3a2bc94cc1361f9df7a189e640bc236 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -2320,6 +2320,18 @@ _require_freeze()
        [ $result -eq 0 ] || _notrun "$FSTYP does not support freezing"
 }
 
+# Does shutdown work on this fs?
+_require_scratch_shutdown()
+{
+       [ -x src/godown ] || _notrun "src/godown executable not found"
+
+       _scratch_mkfs > /dev/null 2>&1
+       _scratch_mount
+       src/godown -f $SCRATCH_MNT 2>&1 \
+               || _notrun "$FSTYP does not support shutdown"
+       _scratch_unmount
+}
+
 # arg 1 is dev to remove and is output of the below eg.
 # ls -l /sys/class/block/sdd | rev | cut -d "/" -f 3 | rev
 _devmgt_remove()
index 974934592879ae7ff9a35730663daa0c3cbce064..6428d5c73d19756c8bcaf2f0e0af95e2df3231fd 100755 (executable)
@@ -86,6 +86,7 @@ _crashtest()
 _supported_fs xfs
 _supported_os Linux
 _require_scratch
+_require_scratch_shutdown
 _require_xfs_io_command "falloc"
 _require_xfs_io_command "fpunch"
 _require_xfs_io_command "fzero"
index 54c2d018f7e869185870ee70a8181c0d5365bd1b..539f3245000261744e3e88cd37109c7ec294d8ee 100755 (executable)
@@ -47,6 +47,7 @@ rm -f $seqres.full
 rm -f $tmp.log
 
 _require_scratch
+_require_scratch_shutdown
 
 echo "mkfs"
 _scratch_mkfs_xfs >>$seqres.full 2>&1 \
index af09c7f1154a816afd9bc36c4e99861e4c332211..08566d7be16c58738036a17ee8ea855cbbe84803 100755 (executable)
@@ -44,6 +44,7 @@ _supported_os IRIX Linux
 
 rm -f $seqres.full $tmp.*
 _require_scratch
+_require_scratch_shutdown
 _require_v2log
 
 echo "*** init FS"
index 3a3fb49ef20d729c25fcdb0c076bc263048e7e54..42c7d3be9cc0a8efb58215202310c03d6705acd9 100755 (executable)
@@ -59,6 +59,7 @@ _supported_os IRIX Linux
 
 rm -f $seqres.full $tmp.*
 _require_scratch
+_require_scratch_shutdown
 _require_v2log 
 _require_xfs_quota
 
index 79b3b8956d8718e43d387039d49fdfeece0cb07f..662a2677f9a7dddb550b855ceb27806a8b654599 100755 (executable)
@@ -40,6 +40,7 @@ _supported_fs xfs
 _supported_os Linux IRIX
 
 _require_scratch
+_require_scratch_shutdown
 _scratch_mkfs_xfs >/dev/null 2>&1
 _scratch_mount
 
index 1b11cf65392682adff291ba79abb30f84bd4c7b6..3fb182c368a8c239fadb22d52e96de9c26a26f30 100755 (executable)
@@ -40,6 +40,7 @@ _supported_fs xfs
 _supported_os Linux IRIX
 
 _require_scratch
+_require_scratch_shutdown
 _scratch_mkfs_xfs >/dev/null 2>&1
 _scratch_mount
 
index e5296f707dac85a8c3b3160db201d8d341577333..6986c1758f945bbefb76879474629d7e8072e4cd 100755 (executable)
@@ -40,6 +40,7 @@ _supported_fs xfs
 _supported_os Linux IRIX
 
 _require_scratch
+_require_scratch_shutdown
 _scratch_mkfs_xfs >/dev/null 2>&1
 _scratch_mount
 
index cccf26283d02756359e7e17deb86e9c5e8c0d1eb..b82e43b9e767d63c5ddfd7fbc63cfc075292d675 100755 (executable)
@@ -40,6 +40,7 @@ _supported_fs xfs
 _supported_os Linux IRIX
 
 _require_scratch
+_require_scratch_shutdown
 _scratch_mkfs_xfs >/dev/null 2>&1
 _scratch_mount
 
index ce50d99afbb485e5b3e5051676aaa380157936c1..87fac8a19d6085648d7053d31185b2631ecae0a2 100755 (executable)
@@ -41,6 +41,7 @@ _supported_fs xfs
 _supported_os Linux IRIX
 
 _require_scratch
+_require_scratch_shutdown
 _scratch_mkfs_xfs >/dev/null 2>&1
 _scratch_mount
 
index a0fb69a97a7af7867b58842205c306a9fcf6116a..b3b0fe4b83cf13404ee650bd5c65df80f1f5a348 100755 (executable)
@@ -41,6 +41,7 @@ _supported_fs xfs
 _supported_os Linux IRIX
 
 _require_scratch
+_require_scratch_shutdown
 _scratch_mkfs_xfs >/dev/null 2>&1
 _scratch_mount
 
index b75e4fc514b1de9f82965ea42ecc60cddd9132bf..dac15d4c8580a086bc614f538109794f4d99eb7d 100755 (executable)
@@ -41,6 +41,7 @@ _supported_fs xfs
 _supported_os Linux IRIX
 
 _require_scratch
+_require_scratch_shutdown
 _scratch_mkfs_xfs >/dev/null 2>&1
 _scratch_mount
 
index f0c4337dd348c09fc2d501932211305c9271348a..c62d2b8616d21dd4376ddfc93bfbcdd09dbcea1d 100755 (executable)
@@ -45,6 +45,7 @@ _supported_fs xfs
 _supported_os Linux
 
 _require_scratch_nocheck
+_require_scratch_shutdown
 
 _scratch_mkfs_xfs >/dev/null 2>&1
 
index 3053fd92ae8837fec6075cd7c35903eef70f8d00..5af5aced27370a6cdb0006e76998efad9858245f 100755 (executable)
@@ -49,6 +49,7 @@ _supported_fs xfs
 _supported_os Linux
 
 _require_scratch
+_require_scratch_shutdown
 
 rm -f $seqres.full