generic/003: ensure time changes between stat calls
authorDave Chinner <dchinner@redhat.com>
Thu, 13 Mar 2014 03:58:24 +0000 (14:58 +1100)
committerDave Chinner <david@fromorbit.com>
Thu, 13 Mar 2014 03:58:24 +0000 (14:58 +1100)
commit84edd7a86869989bf05963d6062e51acd2aedae5
tree62938700bda9528d239510c9922aa5c0fff2684c
parent97a665b5fc3487e86443e507244cc5fb1a08550c
generic/003: ensure time changes between stat calls

On a fast device like a ramdisk, kernel time may not have changed
between a stat of a file and some operation on it immediately
afterwards. Hence there is no guarantee that an operation actually
changes the timestamps of a file immediately after it is stat'd.

Hence, ensure that the times will change by sleeping for a second
between the initial stat that reads the timestamps and the
operations that is supposed to modify them. This way we ensure that
the timestamp will change if the filesystem is correctly
implemented.

While there, fix the indenting to be 8 space tabs and correct the
header which is missing the bash shell declaration and the test
number identifier.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
tests/generic/003