generic/508: fix to check inode creation time feature on scratch mountpoint
authorChao Yu <yuchao0@huawei.com>
Sat, 27 Oct 2018 01:55:20 +0000 (09:55 +0800)
committerEryu Guan <guaneryu@gmail.com>
Sun, 28 Oct 2018 13:13:40 +0000 (21:13 +0800)
_require_btime() just check inode creation time feature on TEST_DIR
mountpoint, but generic/508 needs to do that check on SCRATCH_MNT
mountpoint. Let's add _require_scratch_btime() for that, meanwhile
handling scratch_{mkfs,mount,umount} inside the function to decouple
with caller.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
common/rc
tests/generic/508

index 38d9de7207ee68af0a3176d82ab6566359c63793..d20bb36cba58fec3896ae2d1b112fb56c583be61 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -3830,6 +3830,19 @@ _require_btime()
        rm -f $TEST_DIR/test_creation_time
 }
 
        rm -f $TEST_DIR/test_creation_time
 }
 
+_require_scratch_btime()
+{
+       _require_scratch
+       _scratch_mkfs > /dev/null 2>&1
+       _scratch_mount
+
+       $XFS_IO_PROG -f $SCRATCH_MNT/test_creation_time -c "statx -v" \
+               | grep btime >>$seqres.full 2>&1 || \
+               _notrun "inode creation time not supported by this filesystem"
+
+       _scratch_unmount
+}
+
 init_rc
 
 ################################################################################
 init_rc
 
 ################################################################################
index b869b3a9c2601b9068c8d7262642012b32b02c89..3c2d4aa11169171e90bc50e47538c56974f28206 100755 (executable)
@@ -46,10 +46,10 @@ _supported_os Linux
 _require_test_lsattr
 _require_statx
 _require_xfs_io_command "statx" "-v"
 _require_test_lsattr
 _require_statx
 _require_xfs_io_command "statx" "-v"
-_require_btime
 
 _require_scratch
 _require_scratch_shutdown
 
 _require_scratch
 _require_scratch_shutdown
+_require_scratch_btime
 
 _scratch_mkfs >/dev/null 2>&1
 _require_metadata_journaling $SCRATCH_DEV
 
 _scratch_mkfs >/dev/null 2>&1
 _require_metadata_journaling $SCRATCH_DEV