generic/258: check filesystem support for negative timestamps
authorLuis Henriques <lhenriques@suse.com>
Wed, 4 Mar 2020 16:11:20 +0000 (16:11 +0000)
committerEryu Guan <guaneryu@gmail.com>
Mon, 6 Apr 2020 12:21:32 +0000 (20:21 +0800)
Some filesystems do not support negative c/m/atime timestamps. And
for these filesystems, generic/258 will fail.

Since there's currently no way to check sb->s_time_min from
userspace, this patch adds a new common/rc function
_require_negative_timestamps() that will _notrun depending on the
$FSTYP variable.

Signed-off-by: Luis Henriques <lhenriques@suse.com>
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
common/rc
tests/generic/258

index 454f5ccf56f0b9992f24b15a90f8466a2d69ca4f..d30204e6bdbd75351c9b05db505d09ea5986483b 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -4168,6 +4168,14 @@ _check_xfs_scrub_does_unicode() {
        return 0
 }
 
+_require_negative_timestamps() {
+       case "$FSTYP" in
+       ceph)
+               _notrun "$FSTYP does not support negative timestamps"
+               ;;
+       esac
+}
+
 init_rc
 
 ################################################################################
index 68b8155d4a9f817170562af0181136943f1a1537..dab1a476ed209a71946fd2cc5b4aa562b14cce34 100755 (executable)
@@ -30,6 +30,7 @@ trap "_cleanup ; exit \$status" 0 1 2 3 15
 _supported_fs generic
 _supported_os Linux
 _require_test
+_require_negative_timestamps
 
 TESTFILE=$TEST_DIR/timestamp-test.txt