From d98030d212915eb903830df07024076e9000d0fe Mon Sep 17 00:00:00 2001 From: Chao Yu Date: Sat, 27 Oct 2018 09:55:20 +0800 Subject: [PATCH] generic/508: fix to check inode creation time feature on scratch mountpoint _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 Reviewed-by: Dave Chinner Signed-off-by: Eryu Guan --- common/rc | 13 +++++++++++++ tests/generic/508 | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/common/rc b/common/rc index 38d9de72..d20bb36c 100644 --- a/common/rc +++ b/common/rc @@ -3830,6 +3830,19 @@ _require_btime() 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 ################################################################################ diff --git a/tests/generic/508 b/tests/generic/508 index b869b3a9..3c2d4aa1 100755 --- a/tests/generic/508 +++ b/tests/generic/508 @@ -46,10 +46,10 @@ _supported_os Linux _require_test_lsattr _require_statx _require_xfs_io_command "statx" "-v" -_require_btime _require_scratch _require_scratch_shutdown +_require_scratch_btime _scratch_mkfs >/dev/null 2>&1 _require_metadata_journaling $SCRATCH_DEV -- 2.30.2