generic/402: skip test if xfs_io can't parse the date value
authorDarrick J. Wong <darrick.wong@oracle.com>
Wed, 4 Mar 2020 02:46:34 +0000 (18:46 -0800)
committerEryu Guan <guaneryu@gmail.com>
Sun, 8 Mar 2020 15:40:22 +0000 (23:40 +0800)
commit640c75ef96e221be90b9120aa5b2b120e497fe7e
treecc575d5da6c1f7464598f14f344317bdf77a22a5
parenta0b98ada02fc684c66c62049fa783795898e1f17
generic/402: skip test if xfs_io can't parse the date value

If xfs_io's utimes command cannot interpret the arguments that are
given to it, it will print out "Bad value for [am]time".  Detect
when this happens and drop the file out of the test entirely.

This is particularly noticeable on 32-bit platforms and the largest
timestamp seconds supported by the filesystem is INT_MAX.  In this
case, the maximum value we can cram into tv_sec is INT_MAX, and
there is no way to actually test setting a timestamp of INT_MAX + 1
to test the clamping.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
tests/generic/402